on 11-16-2007 11:07 AM
Hi,
I have a table in webdynpro to which i want to bind a node at runtime. The node is created at run time but the table already exists.
How do i achieve this?
Malita
void wdDoModifyView(...)
{
if (<not_yet_bound>)
{
IWDNodeInfo nodeInfo = wdContext.getRootNodeInfo().getChild(<name of data source node>);
IWDTable table = (IWDTable) view.getElement(<ID of table>);
table.bindDataSource(nodeInfo);
/* bind editor, say InputField, of first table column */
IWDInputField editor = (IWDInputField) view.getElement(<ID of editor>);
editor.bindValue(nodeInfo.getAttribute(<name of edited attribute>));
/* and so on... */
}
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Malati,
Check this.
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6fdae690-0201-0010-a580-d104b459cb44">Dynamically Creating, Building and Mapping a Context in Web Dynpro</a>
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use the following
IWDTable iTab = (IWDTable)view.getElement("Table"); // your table
iTab.bindDataSource("Root"); // the context path of the attribute
following are the different variants of the bind method.
public void bindDataSource(String path);
public void bindDataSource(IWDNodeInfo nodeInfo);
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,
Sample Code to bind a Node to a table with all attributes.
IWDTransparentContainer container = (IWDTransparentContainer)view.getElement("RootUIElementContainer");
container.destroyAllChildren();
IWDTable iTab = (IWDTable)view.createElement(IWDTable.class,null);
iTab.bindDataSource("Root");
Iterator itr1 = wdContext.getChildNode("Root",0).getNodeInfo().iterateAttributes();
while(itr1.hasNext())
{
IWDTableColumn iTabCol = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
IWDInputField input= (IWDInputField)view.createElement(IWDInputField.class,null);
IWDAttributeInfo iWDInfo = (IWDAttributeInfo) itr1.next();
input.bindValue("Root."+iWDInfo.getName());
iTabCol.setTableCellEditor(input);
IWDCaption iCap = (IWDCaption) view.createElement(IWDCaption.class, null);
iCap.setText(iWDInfo.getName());
iTabCol.setHeader(iCap);
iTab.addGroupedColumn(iTabCol);
}
container.addChild(iTab);
REgards
Ayyapparaj
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.