on 09-06-2012 12:58 PM
Hello All,
I am displaying a table using webdynpro, this table has say 10 columns, Now when user clicks on a buttion i need to hide five fields (columns) of the table and display remaining 5 fields(columns).
what steps/code i should follow in the onaction of the buttion?
i tried to use SET_ATTRIBUTE_PROPS_FOR_NODE and SET_ATTRIBUTE_PROPS_FOR_ELE also but didnt get the result, or how to use these methods correctly?
Hi Ramanuja,
The TableColumn UI element has a property, visible, which you can bind to a context attribute of type WDY_BOOLEAN. Upon click of your button, you could change the value of the bound attribute to either abap_true or abap_false using method IF_WD_CONTEXT_NODE->SET_ATTRIBUTE.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Amy King
Thanks for the reply, But here i want to have more similar buttions, upon clicking on each buttion some columns has to dispaly and some columns has to hide, its some thing like layout variant in alv,
in that case i can not bound certain value to the context attribute.
so i want bind the visible property in the method itself, pls suggest if there is any other way?
Hi Ramanuja,
"in that case i can not bound certain value to the context attribute."
I'm not sure I understand why the approach doesn't fit your requirement. Let's say you create a context node, VISIBLE, and add to it one attribute for each column in your table. Next, bind each TableColumn.visible property to its corresponding context attribute. Then in the action handler for each button, you can set the individual TableColumns to be visible or hidden as needed according to the "layout variant" you want to display.
Cheers,
Amy
Hi Ramanuja,
You can use this approach in different ways. I imagine you can reuse certain context attributes for more than one TableColumn according to how many "layout variants" you have and which columns show or hide in each variant. You just need to analyze which columns display when.
However, if a dynamic solution is preferable for your scenario, you can still do so by getting an instance of each TableColumn (which uses runtime class CL_WD_TABLE_COLUMN) and calling method CL_WD_TABLE_COLUMN->SET_VISIBLE. The parameter for this method is of type WDUI_VISIBILITY. Here's the documentation for TableColumn.
Cheers,
Amy
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.