on 02-28-2008 12:28 PM
Hi,
Iam working on the Customization of table in WebDynpro.I have an application which has 2 views - TableView and CustomView.In the CustomView i have a dropdownbyindex ui element which has the values as "Standard", "Transparent", "Alternating".When the user selects any of these values and clicks on the Apply button, the table design should be changed in the TableView.
Can anyone guide me as how to proceed with this?
I hope i made my requirement very clear.
Regards,
Padmalatha.K
Points will be rewarded.
Hi,
Create an attribute of type "TableDesign" [com.sap.ide.webdynpro.uielementdefinitions.TableDesign]
bind this attribute to the Type property of the table.
In the init set the values as follows. or else change according your need.
wdContext.currentContextElement().setTableDesign(WDTableDesign.STANDARD);
And in the action handler of your drop down by index you can use the following code
In the below code my attribute name is TableDesign
Based on the condition you can use the following code to change the Type.
//Assuming the key returns you the selected value as int 0..1..2
switch (key) {
case 1:
wdContext.currentContextElement().setTableDesign(WDTableDesign.ALTERNATING);
break;
case 2:
wdContext.currentContextElement().setTableDesign(WDTableDesign.TRANSPARENT);
break
default:
wdContext.currentContextElement().setTableDesign(WDTableDesign.STANDARD);
break;
}
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,
I have an application with a view which has a table UI element.I want to set the design property of that table at runtime.For that i created a context attribute called Design of type com.sap.ide.webdynpro.uielementdefinitions.TableDesign.I set the design property of the table Design.Now in the
WDDoModify method of the view, i have written this line of code to set the table design to be Alternating
wdContext.currentContextElement().setMyDesign(WDTableDesign.ALTERNATING);
Have i done it correctly?But still the table design is coming as Standard..........Is there anything else i need to set?
Please help...........
Regards,
Padmalatha.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes. The readOnly property of the table to true. Please check the document for its property:
http://help.sap.com/saphelp_nw70/helpdata/en/6e/ae0e422dfcdc2ce10000000a1550b0/frameset.htm
thanks & regards,
Manoj
Hi
You can set an element at the controller context and make it as a flag for the 3 criteria for the drop down key. on the second view, make an if condition
if( wdContext.currentContextElement.getTableDesignFlg().equals( "1"))
{
tableObj.setTableDesign( WDTableDesign.STANDARD );
}else if( wdContext.currentContextElement.getTableDesignFlg().equals( "2"))
{
tableObj.setTableDesign( WDTableDesign.TRANSPARENT );
}else
{
tableObj.setTableDesign( WDTableDesign.ALTERING );
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a context variable say "tableDesign" of type com.sap.ide.webdynpro.uielementsdefinitions.TableDesign,which can be found in SimpleType.Bind it to the design property of the table.Now in the onselect action of the dropdown,change the design as you need.
In the onselect action handler of dropdown give
wdContext.currentTableDesignElement().setTableDesign("Standard");
I think in your case create a tableDesign context variable in the component controller also.Map from view controller to context controller.In the TableDesign view also have the tableDesign context variable and map it to the ComponentController,so that the tableDesign selected in the first view appears in the second view.Now bind this to the design property of the table in tabledesign view.No need of any code
Regards,
Sudhir
Edited by: Sudhir Gorantla on Feb 28, 2008 1:40 PM
Edited by: Sudhir Gorantla on Feb 28, 2008 2:00 PM
Edited by: Sudhir Gorantla on Feb 28, 2008 2:06 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
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.