on 01-07-2008 9:18 AM
Hi all,
Im creating tabstrip and table dynamically. I created one value attribute(integer type) for inputfield.I will enter number of columns in input field.I binded this attribute to inputfield.
While deploying getting this exception :
com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(DynamicTabstripView): unknown child node 0
I wrote this code
IWDTabStrip tabstrip = (IWDTabStrip)view1.createElement(IWDTabStrip.class,"TabStrip");
IWDTab tab = (IWDTab) view1 .createElement(IWDTab.class, "tab");
IWDCaption headerCaption = (IWDCaption)view1.createElement(IWDCaption.class, "HeaderCaption");
headerCaption.setText("Edit");
tab.setHeader(headerCaption);
tab.setVisible(true);
tabstrip.addTab(tab);
IWDTransparentContainer root = (IWDTransparentContainer)view.getRootElement();
IWDTable table = (IWDTable)view1.createElement(IWDTable.class,"TD");
table.bindDataSource(nodeInfo);
table.setVisible(WDVisibility.VISIBLE);
root.addChild(table);
tab.setContent(root);
root.addChild(tabstrip);
IWDLabel label = (IWDLabel) view1.createElement(IWDLabel.class, "lbl");
label.setText("Enter name");
root.addChild(label);
IWDInputField input = (IWDInputField)view1.createElement(IWDInputField.class, "input" );
input.bindValue("" + wdContext.currentContextElement().getInputattr());
input.setEnabled(true);
input.setLength(20);
root.addChild(input);
can anyone give the answer.
Regards
Shirisha
This code looks strange. Where do you wrote it, inside wdDoModifyView()? And where do you get the reference to view1?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for reply.
I wrote the code in wdModifyview() only. I got reference view1 from view. I declared view in at the end of code
//@@begin others
public static com.sap.tc.webdynpro.progmodel.api.IWDView View1;
//@@end
B'coz im using view1 in action code also, that's why i am taking reference from view.
Regards
Shirisha
Hi,
Dont store the views for later use this will crash in case of a clusterd system.
You can make use of context variables to set the readonly/ Visibility and for most of the properties.
I guess you are storing the handle of view to set some properties.
Try to use context attributes in WD. That is the recommended way of implementation
Regards
Ayyapparaj
Hi,
I got the bug in your code.
tab.setContent(root);
In IWDTab you are adding the root transparent container as a content, which is wrong.
Because this is the root container.
you should use different container for this.
(1)create a new container.
IWDTransparentContainer container = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class, "con");
(2)Now add this container in the Tab.
tab.setContent(container);
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,
Can you post the code from where you get the nodeInfo
table.bindDataSource(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,
Thanks for reply.
I am posting the code
IWDNodeInfo nodeInfo = (IWDNodeInfo)wdContext.nodeTableNode().getNodeInfo();
IWDTable table = (IWDTable)view1.createElement(IWDTable.class,"TD");
table.bindDataSource(nodeInfo);
table.setVisible(WDVisibility.VISIBLE);
root.addChild(table);
tab.setContent(root);
root.addChild(tabstrip);
//Label and Input field to enter no.of col's
IWDLabel label = (IWDLabel) view1.createElement(IWDLabel.class, "lbl");
label.setText("Enter name");
root.addChild(label);
IWDInputField input = (IWDInputField)view1.createElement(IWDInputField.class, "input" );
// int n = wdContext.currentContextElement().getInputattr();
IWDMessageManager msgMgr1 = wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr1.reportSuccess("In input attribute" );
input.bindValue("" + wdContext.currentContextElement().getInputattr());
input.setEnabled(true);
input.setLength(20);
root.addChild(input);
//Button and Action
IWDButton button = (IWDButton)view1.createElement(IWDButton.class, "button1");
IWDAction action = wdThis.wdGetClickAction();
button.setText("Enter");
button.setOnAction(action);
Regards
Shirisha
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.