Skip to Content
author's profile photo Former Member
Former Member

Table with Buttons: enable/disable Buttons in special rows

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 02:15 PM

    Hi,

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

    Regards, Anilkumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:26 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:23 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.