on 08-07-2006 10:32 AM
Hi all,
In my WD appl, I have a table and some editor feilds of type InputField. I can enter only one row, bcoz only one row is enabled. How to add more values like 5 rows in a table.
The code in CustomControiller is:
public void wdDoInit()
{
//@@begin wdDoInit()
Y_Ep_Demo_Po_Create_Input ip=new Y_Ep_Demo_Po_Create_Input(); Yepdemoekpo po = new Yepdemoekpo();
ip.addT_Ekpo(po);
wdContext.nodeY_Ep_CreatePO().bind(ip);
//@@end
}
Plz help me. Here T_Ekpo is of type Table.
Thanks a lot in advance
Hi,
To create 5 rows in a table, you need 5 elements of the node bound as the datasource of the table.
So run a for loop, create 5 elements and instead of doing a bind, do an addElement(IWDNodeElement).
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satyajit,
Y_Ep_Demo_Po_Create_Input ip=new Y_Ep_Demo_Po_Create_Input();
Yepdemoekpo[] po = new Yepdemoekpo();
for(int i=0;i<5;i++)
{ip.addT_Ekpo(po<i>);
}
wdContext.nodeY_Ep_CreatePO().bind(ip);
This is the way i did, but its reporting some error like
Cannot conert from Yepdemoekpo to Yepdemoekpo[].
How to do this?
Thanks a lot
Hi
all the rows will be added by this method. You can check it by bind a value to the parameter.
Try this
Y_Ep_Demo_Po_Create_Input ip=new Y_Ep_Demo_Po_Create_Input();
for(int j=0;j<5;j++){
Yepdemoekpo po = new Yepdemoekpo();
po.set<Param>(String.valueOf(j));
ip.addT_Ekpo(po);
}
wdContext.nodeY_Ep_CreatePO().bind(ip);
Hi Mukesh,
I have a button called Add next to table row. There shud be intially only one row, when i click the Add btn then another row has to be added. How to do this?
The code in wdInit() method of View is:
public void onActioninsertRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActioninsertRow(ServerEvent)
wdThis.wdGetPoCustController().executeInsertRow();
IPrivatePoCompView.IT_EkpoElement ele=(IPrivatePoCompView.IT_EkpoElement)
(wdContext.nodeT_Ekpo().createElement());
wdContext.nodeT_Ekpo().addElement(ele);
//@@end
}
Thanks a lot in advance
Hi Mukesh,
The error i got when i clicked on Add button is:
com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(PoCust.Y_Ep_CreatePO.T_Ekpo): value node is created without a reference
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.packElement(NodeInfo.java:881)
at com.sap.tc.webdynpro.progmodel.context.MappedNodeElement.<init>(MappedNodeElement.java:36)
at com.sap.demo.app.wdp.IPrivatePoCompView$IT_EkpoElement.<init>(IPrivatePoCompView.java:477)
at com.sap.demo.app.wdp.IPrivatePoCompView$IContextNode.doCreateElement(IPrivatePoCompView.java:56)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:854)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1346)
...
Where and how to write the code to work effectively. The button is properly bound
Thanks
Hi
It Seems that the node which you created in the Custom Controller is not match with the node in Component Controller or View.
Check the Bind of the Node.
Remove the current node from view and component controller .
Re Bind the node from Custom controller to Component Controller and to the View
Kind Regards
Mukesh
Hi
Try this
public void onActioninsertRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
IPrivate<ViewName>.I<Name>Node node = wdContext.node<Name>();
IPrivate<ViewName>.I<Name>Element element = wdContext.create<Name>Element();
element.set<Param>("Value");
node.addElement(element);
}
Kind Regards
Mukesh
User | Count |
---|---|
88 | |
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.