on 09-15-2015 3:53 PM
Hello All,
I'm trying to disable all controls that are placed inside another control/container. In my case this container is sap.ui.commons.layout:VerticalLayout, which has in its "content" aggregation all kinds of different controls. I would like to disable all of them at once.
I tried this:
var oControl = this.getView().byId("GeneralOrderDataTabContent");
oControl.setEnabled(false);
This had no effect.
Any idea how to solve this?
Thanks!
Szilamér
Hi Szilamér,
the sap.ui.commons.layout.VerticalLayout control is deprecated for a long time (since 1.16). It recommends using the sap.ui.layout.VerticalLayout.
However, as both share the same code, it should still work, and for me it does:
http://jsbin.com/lequrawage/edit?html,output
Which version of UI5 are you using? The above refers to 1.26.
Regards
Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andreas,
I'm using the latest UI5 version (1.30). I also replaced the deprecated control with the new one.
I just noticed, that my two buttons are really disabled (like in your example), but none of the other controls (TextField, DatePicker, ComboBox, etc.).
Shouldn't this affect all of them?
Regards,
Szilamér
Hi,
I think this is a bug .The enabled property of the vertical layout has effect on sap.m controls and sap.ui.commons.Button. It doesn work for other sap.ui.commons controls.
JS Bin - Collaborative JavaScript Debugging
So as a work around you can follow pau marti response or use oly sap.m. controls.
Before the bug is fixed. I believe that we can use busy property as a hack
JS Bin - Collaborative JavaScript Debugging
Thanks
-D
Hi Szilamér, you can not disable all controls like this, the best way is using a json model and bind enabled property. Regards,
Pau
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.