on 07-16-2013 9:19 AM
Hi,
Is it possible to show / hide Web Dynpro Abap table column dynamically?
I want to hide / show column of a table.
Thank you.
Hi fikret,
follow the steps:
1. get the table from the root->view->get_element('table').
2. get the column from lr_table->get_column('col_id').
3.change visibility value as per your condition like
lr_column->set_visibility( '02'). or '01'
thanks & regards,
kishorekumar SVS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fimret,
At the action level , visibility property is possible only by attribute mapping.
create attribute type of wdui_visibility in the context , bind this attribute to visibility property of table column.Fill the values as per your condition as '01' or '02'.
I hope solved your problem.
thanks & regards,
Kishorekumar SVS
Hi Fikret,
1. Define an attribute of type WDUI_VISIBILITY as one of the attribute in table node . i.e Context node which is binded with data source property of Table.
2. Bind this attribute with the visible property of the respective column which u want to hide.
3. For the first time before displaying the table, at the time binding/appending other values to table,
make this attribute value as '02' = Visible.
4.On particular action if u want to hide the column, do the below mentioned points on action
i) get the table
ii) modify the visible attribute value = '01'
iii) bind the table to the node and display
By doing so, you will be able hide the column(s) at runtime.
Hope it will be helpful.
Thankyou.
Hi,
Simply bind the visibility of your table column with an attribute of type bool.
Use 'Set' method to fill the value in that attribute as per your scenario. i.e. if needs to display then set value as 'X' or else set it as ' '.
Regards,
Keshav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fikret ,
1. Define an attribute of WDY_BOOLEAN type in context node.
2.Map this attribute with table column on which u want to set visibility.
3 .Set visibility at condition where u want to show this column by set attribute as 'X'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For table column visiblity property assoicate context attribute of type visibility; dynamically code for showing or hiding the column
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is possible, 1. Create an attribute in the view context type 'WDY_BOOLEAN'. Lets say your node called hidenode and the attribute hideattribute 2. Select the column which you want to hide. 3. In the properities of this column there is a filed called 'visible' 4 Click on the yellow button on the right of this visible field. 5. Bind it with the attribute that you created in the first step. 6. You can now hide or show this column 7. Just write these codes in an action (maybe a button called 'Hide Column' and another button 'Show Column') The below code will hide your column
DATA lo_nd_context TYPE REF TO if_wd_context_node.
DATA lo_el_element TYPE REF TO if_wd_context_element.
DATA lv_hide_column TYPE wd_this->[enter your node]-[enter your attribute].
"like DATA lv_hide_column TYPE wd_this->hidenode-hideattribute."
* navigate from <CONTEXT> to <AYLAR> via lead selection
lo_nd_context = wd_context->get_child_node( name = wd_this->wdctx_[enter your node] ).
lo_el_element = lo_nd_context->get_element( ).
lo_el_element->set_attribute(
name = `[enter your attribute]`
value = ABAP_FALSE ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Fikret
It is possible
Please refer to
Dynamically Hiding table control fields
http://wiki.sdn.sap.com/wiki/display/WDABAP/Dynamically+Hiding+table+control+fields
http://www.saptechnical.com/Tutorials/WebDynproABAP/Hide/Page3.htm
and
http://scn.sap.com/thread/1123118
http://scn.sap.com/thread/2018569
Kind Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.