on 03-03-2009 5:32 PM
Hi Experts,
In my Webdynpro application in first view two radio buttons are there. In second view one table with multiple columns are there.
The radio button and the value in table is getting populated from BAPIs.
My task is depending on one radio button which i am selecting on the first view, few columns of the table control needs to be hidden.
Can anybody please explain me the logic how to do it.If i can get some code f
Thanks a lot.
Hi Srini,
The radio button and the value in table is getting populated from BAPIs.
My task is depending on one radio button which i am selecting on the first view, few columns of the table control needs to be hidden.
get the value from Bapi for ur radio button and set it to some context attribute. and create a action say "select " and bind this action to OnSelect property of radio button.
Create a context Attribute say "tableColumnVisibility" of type IWDVisibility and bind it to the Visibility property of the columns.
in this Action method , do the validation check .
for eg : if(wdContext.currentContextElement.getSelectedKey().equals("Test")){
//Show the required table columns , enable the visibility property
wdContext.currentContextElement.settableColumnVisibility(IWDVisibility.VISIBLE);
}else {
//Hide the table columns
wdContext.currentContextElement.settableColumnVisibility(IWDVisibility.NONE);
}
Hope it helps:
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1)create the value attribute in context saying vis
2)Set its type as com.sap.ide.webdynpro.uielementdefinitions.Visibility
3)create action for the radio button and change the visibilty as none in wdinit
3)map this value attribute to the visible property of the table
4)create context attributes with the required elements and then set the values
5) then again set the visibility as visible.wdContext.currentContextElement().setVis(WDVisibility.VISIBLE);
regards
vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Say you are using individual radio buttons and both button's "selectedKey" property is bound to the same context attribute "gender" which can have values "male" and "female" (or be NULL).
First, move context attribute "gender" to the component controller, then create a context mapping from both views.
Then you have access to the selected value also in the view containing the table. To control the column visibilities, you can for example use calculated attributes.
Example: (Context of view with table)
Context
- gender (attribute, string)
- column1Visibility (calculated attribute, com.sap.ide.uielementdefinitions.Visibility)
- column2Visibility (calculated attribute, com.sap.ide.uielementdefinitions.Visibility)
Bind TableColumn "visibility" properties to these attributes and implement get-methods like
/* Make this column visible if gender is "male" */
WDVisibility getColumn1Visibility(IContextElement element)
{
return "male".equals( element.getGender() ) ? WDVisibilty.VISIBLE : WDVisibility.NONE;
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.