on 09-24-2008 1:21 AM
HI Experts....
I'm having a problem while updating data in table.........that is .....
im entering data in Form.....Having a button Called Add to Table........Form contains some field's whenever clcking that button i need to up date corresponding data.....one after other ........
on leadselection i have to display corresponding table content details....... 3rd view...all 3views embbeded in view container.......
Both form and table are in different views
My problem is how to Add the data/updating the table each time clicking Add button in first view....?
Regards ......
RAM
ya finally i got solution with your help
Thank you all
Ramprasad....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramprasad,
Your problem is how to Add the data/updating the table each time clicking Add button in first view....?
1) Create Nodes/attributes for form and table at Controller level and map to all corresponding views.so all views have the following context structure.
let us Assume two nodes as below
NodeForm(node)
---name(attribute)
NodeTable(node)
-
name1(attribute)
2) In first view you have form with UI binded to NodeForm and a button. Then what u do is create View Container UI in first view and add second view(which has table UI binded with NodeTable) to the View Container. Such that u can see both the Form and Table at a time.
3) Under Button implementation write the following code
IPrivateExpView.ITableElement ele = wdContext.createTableElement();
ele.setName(wdContext.nodeForm().currentFormElement().getName());
wdContext.nodeTable().addElement(ele);
wdContext.nodeForm().invalidate();
So for every click on button the table UI is appended with Form data and the Form UI input field will be refreshed.
I had tried this it is working. Hope this will solve your requirements. Revert me if any queries or else close the thread.
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
instead of declaring context attributes at view level, declare them at Component level and map the variables to all the view where ever necessary. So that now in form1 when you click Add to table button, set the values of context variables and fire a plug to view3.
in the onplugfrom method of view3, set the values of table with valus of form1 context(which are declared at component level)...
For more info on how to map context element between view and controller refer this thread...
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
for Add row to Table use this,
IEmpFormElement formElement = wdContext.currentFormElement();
IEmpTableNodeElement element = wdContext.nodeEmpTableNode().createEmpTableNodeElement();
element.setEmpName(formElement.getEmpName());
element.setEmpAge(formElement.getEmpAge());
element.setEmpRoll(formElement.getEmpRoll());
element.setEmpGrade(formElement.getEmpGrade());
wdContext.nodeEmpNode().addElement(element);
for Update a particular row,
IEmpFormElement formElement = wdContext.currentFormElement();
IEmpNodeElement element = wdContext.nodeEmpNode().getEmpNodeElementAt(wdContext.nodeEmpNode().getLeadSelection());
element.setEmpName(formElement.getEmpName());
element.setEmpAge(formElement.getEmpAge());
element.setEmpRoll(formElement.getEmpRoll());
element.setEmpGrade(formElement.getEmpGrade());
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
write a code in ADD button like as follow.
for(int j=0;j<=wdContext.nodeTable_1().size();j++)
{
IPrivateAssi3View.ITable_1Element tabadd = wdContext.createTable_1Element();
tabadd.setDept_ID(wdContext.currentTable_1Element().getDept_ID());
tabadd.setName(wdContext.currentTable_1Element().getName());
tabadd.setPSNO(wdContext.currentTable_1Element().getPSNO());
wdContext.nodeTable_1().addElement(tabadd);
}
here nodeTable_1() is node which binds to the table and getDept_id,name and psno is value attribute of node.
hope it will help u.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramprasad,
This attached step by step tutoraial is some thing to similar to your requirement.
From SDN tutorial , "Working with Web Dynpro tables" attached here.
Thanks
Krishna
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.