cancel
Showing results for 
Search instead for 
Did you mean: 

How to change 'visible' attribute of a column editor for each line in table

Former Member
0 Kudos

Hi,

I have a table with 5 columns.

one column has a button that moves the user to a new URL if clicked.

I want to enable the same button depending on the data that is stored in the binded internal table (but is not presented on the screen).

How can I change the visible attribute of the column editor for each line in the table?

Thanks,

Itay

Accepted Solutions (1)

Accepted Solutions (1)

former_member402443
Contributor
0 Kudos

Hi Avni,

As per question, You have a table with 5 columns.

one column has a button that moves the user to a new URL if clicked.

I want to enable the same button depending on the data that is stored in the binded internal table (but is not presented on the screen).

How can I change the visible attribute of the column editor for each line in the table?

For this you have to create another context attribute in the same node that you are using for the table data to store the enabled Or visible property of each line.

If you want to enable the button then you can use the type WDY_BOOLEAN else if you want to make button visible then you can use the type WDUI_VISIBILITY for that newly created attribute.

Then bind this attribute to the Button property which you want Either Enable/visible .

While filling the Internal table then based on the condition for which you want to make the button enable or disabled you can set the ENABLE value to ABAP_TRUE or ABAP_FALSe for that attribute.

At runtime the button of a particular record for which the ENABLE attribute value has ABAP_TRUE are enabled, if it is ABAP_FALSE the button is disabled.

For example :

LOOP AT lt_node INTO ls_node.

IF condition = something.

ls_node-enable = abap_true.

ELSE.

ls_node-enable = abap_false.

ENDIF.

MODIFY lt_node INDEX sy-tabix FROM ls_node TRANSPORTING read_only.

ENDLOOP.

Hopes this will helps you

Regards

Manoj Kumar

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

Bind the enabled property of button with a attribute say CA_ATTR of type WDY_BOOLEAN.

Now based on the data in internal table you have to set the value of CA_ATTR to 'X' or " ".

Say u have to enable the button then use the following code.

DATA lo_el_context TYPE REF TO if_wd_context_element.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • set single attribute

lo_el_context->set_attribute(

name = `CA_ENABLE`

value = 'X' ).

Similarly for disabling the button set the attribute value to blank.

DATA lo_el_context TYPE REF TO if_wd_context_element.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • set single attribute

lo_el_context->set_attribute(

name = `CA_ENABLE`

value = ' ' ).

Thanks

Pankaj

Former Member
0 Kudos

Hi

bind ur table column with the context attribute WDY_BOOLEAN . Its initial value is "TRUE" In personalization, this property can be assigned the value falseand it is enabled . it specifies whether or not an event can be triggered by a user interaction.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

create another context attribute in the node binded to the table control to store the enabled Or visible property of each line.

ENABLE of type WDY_BOOLEAN

bind this attribute to the Button.

while filling the Internal table based on the other column set the ENABLE value to ABAP_TRUE or ABAP_FALSE.

at runtime the button of a particular record for which the ENABLE attribute value has ABAP_TRUE are enabled, if it is ABAP_FALSE the button is disabled.

I hope it is clear

Abhi