cancel
Showing results for 
Search instead for 
Did you mean: 

Disable container content

xyla
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

AndreasKunz
Advisor
Advisor
0 Kudos

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

xyla
Participant
0 Kudos

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

Former Member
0 Kudos

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.

former_member182862
Active Contributor
0 Kudos

Before the bug is fixed. I believe that we can use busy property as a hack

JS Bin - Collaborative JavaScript Debugging

Thanks

-D

Answers (1)

Answers (1)

PMarti
Active Participant
0 Kudos

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

AndreasKunz
Advisor
Advisor
0 Kudos

Hm, right... there is a mechanism ("EnabledPropagator") which should make this work, but it's not used in all affected controls. I asked internally what's the matter.

Thanks for noticing.