on 08-05-2007 10:57 AM
Hi Experts
My scenario is like this..
There are more than one RFC models and the output list of these models I need to display in a table format.. The display should happen conditionally as per the availabity of the data in the output list..I need to display the data from multiple models at the same time the said table..
Please let me know the methods to create a table with 5 columns and also how to assign the datasource programatically..
THanks and Regards
SU
Hi,
Use only one Table View context.
Model Contexts:
RFC1, RFC2, RFC3
I_Attr11 I_Attr21 I_Attr31
I_Attr12 I_Attr22 I_Attr32
I_Attr13 I_Attr23 I_Attr33
I_Attr14 I_Attr24 I_Attr34
I_Attr15 I_Attr25 I_Attr35
Table Control Context:
Table
I_Attr1
I_Attr2
I_Attr3
I_Attr4
I_Attr5
Execute each model individually and loop through all model contexts...append the rows from each model context to table context.
//access the table node
IWDTableNode tableNode = wdContext.nodeTable();
IWDTableElement tableElem;
//loop thugh the models
for(int i=0; i<RFC1.size(); i++)
{
tableElem = tableNode.createTableElement();
tableElem.setAttr1(RFC1.getRFC1ElementAt(i).getAttr11);
tableElem.setAttr2(RFC1.getRFC1ElementAt(i).getAttr12);
tableElem.setAttr3(RFC1.getRFC1ElementAt(i).getAttr13);
tableElem.setAttr4(RFC1.getRFC1ElementAt(i).getAttr14);
tableElem.setAttr5(RFC1.getRFC1ElementAt(i).getAttr15);
tableNode.addElement(tableElem);
}
//similarly loop thrugh the remaining 2 models and append the table context
Regards
Srikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can u describe ur scenario in detail?
If your table structure means no of table columns and column types are not going to modify at runtime then it is not a good idea to create table dynamically.
For Dynamic creation of table and table column you need to write your code inside wdDoModifyView. because you will get reference of view in that method.
IWDTable <tableref> = (IWDTable) view.createElement(IWDTable.class,"<tablename>");
<tableref>.bindDataSource(wdContext.node<node>().getNodeInfo());
IWDTableColumn <colref> =(IWDTableColumn)view.createElement(IWDTableColumn.class,"F");
IWDInputField inf = (IWDInputField )view.createElement(IWDInputField.class,"d");
inf.bindValue(wdContext.node<node>().getNodeInfo().getAttribute("<attribute>"));
<colref>.setTableCellEditor(inf);
<tableref>.addGroupedColumn(<colref>);
IWDTransparentContainer <grp> =(IWDTransparentContainer)view.getElement("RootUIElementContainer");
<grp>.addChild(<tableref>);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.