cancel
Showing results for 
Search instead for 
Did you mean: 

Table with Buttons: enable/disable Buttons in special rows

Former Member
0 Kudos

Hello,

I guess a little problem.

I got a table with a button-column. In some tablerows I got to disable the button. Not the disable-function is the problem.

When I loop over the table an disable a single button, all buttons are disabled. What is the correct coding?

Thanks a lot, Mario

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You need to create contextattribute of type "WDVISIBILITY" not string.

Regards, Anilkumar

Answers (2)

Answers (2)

Former Member
0 Kudos

Mario,

Let me guess:

You are iterating over IWDTable column and set property of IWDButton table cell editor? Wrong approach.

Right approach: create context attribute with type boolean, and bind "enabled" property of button to this attribute. Make sure that you are creating this attribute either directly in the same node that you are using as table source, or in <b>non-singleton</b> child of thereof.

Also by default boolean attributes has "false" value, so either set them to true in wdDoInit or in supply function.

To enable/disable button just set attribute value to true/false for corresponding node element (element index == row in table)

VS

Former Member
0 Kudos

Thanks a lot.

How about visiblty?

I can not create a value attribute, which contains only the values:

- blank

- none or

- visible

Just these three values are allowed for a button's visiblty (similar to true/false for enabling).

I tried it with a STRING-value attribut. But that dowsn't work.

Regards Mario

Former Member
0 Kudos

Use a context attribute of <b>DDIC type</b> "Visibility". You find these types if you click "Browse..." -> "Local dictionary" -> com.sap.ide.webdynpro.uielementdefinitions

Do <b>not </b>use <b>native type</b> WDVisibility!

Armin

Former Member
0 Kudos

Add a boolean context attribute "ButtonEnabled" under the context node that is used as the table data source.

Bind the Button.enabled property of the table cell editor to this attribute.

Then you can control the enabled state of the button in row #i by the attribute value of the node element at index #i.

Armin

Message was edited by: Armin Reichert