on 03-17-2009 9:42 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.