on 12-24-2007 11:00 AM
hi,
i need to first hide the table and then on clicking a button it should be displayed, button and table are in the same view.please tell which method to be used and how to connect the button to table.i have crated the action also.
Hi,
Create an attribute of type com.sap.ide.webdynpro.uielementdefinitions.Visibility
Map this attribute to the visible property of the table.
Initially set this to WDVisibility.NONE and inside the action handler set this to WDVisibility.VISIBLE.
Ex:
If your attribute name is TableVisibility then
In the init
wdContext.currentContextElement().setTableVisibility(WDVisibility.NONE);
In the button action Handler
wdContext.currentContextElement().setTableVisibility(WDVisibility.VISIBLE);
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nisha,
Create button and Table say "TableID" in the view
(1) Keep a global boolean variable say "showTable".
(2) in the action of button click set this variable as true.
(3) Now in wdDoModifyView method:
IWDTable table=(IWDTable) view.getElement("TableID") ;
if(showTable){
table.setVisible(WDVisibility.VISIBLE);
}else{
table.setVisible(WDVisibility.NONE);
}
Now your problem is solved.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To toggle I guess this should be a better approach.
WDVisibility currentStatus = wdContext.currentContextElement().getVisibility() //Visibility is a context attribute created of type WDVisibility mentioned above
if ( currentStatus.equals(WDVisibility.VISIBLE) )
wdContext.currentContextElement().setVisibility(WDVisibility.NONE);
else
wdContext.currentContextElement().setVisibility(WDVisibility.VISIBLE);
Dont forget to initialize the context variable to a default value either NONE/VISIBLE.
Regards
Ayyapparaj
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.