on 05-15-2008 12:52 PM
Hi all,
I have the context Structrue for a View as :
Value Node:
Context.
- TestNode(Patent Node)
-SampleNode(Child Node)
-Attribute
-Attribute
-StatusNode(Child Node)
-Attribute
-Attribute
Model Node :
Request_Update(Parent node)
-UpdateReqMsg(Child Node)
- Update(Child Node )
--Attributes
--Attributes
- UpdateStatusNode(ChildNode)
--Attributes
--Attributes .
In the view , the Ui elements are bound to the Value nodes .in the Action method of a Button , i want to copy the data to the model nodes and Excecute the Web Service.(So that the User Entered data is saved in the Database).
Please tell me how to copy the data from the value node to the model node, whether i can use the copy service method for copying the data or any other suggestions.
Thanks and Regards
fazal
Hi ,
ArrayList Arr = new ArrayList();
IPrivate<View>.I<valueElement> ele=null;
wdContext.node<model>().moveFirst();
for(int i=0;i<wdContext.node<model>.size();i++)
{
String var1= wdContext.current<model>Element().getvar1();
String var2= wdContext.current<model>Element().getvar2();
ele2 = wdContext.create<value>Element();
ele2.setvar1(var1);
ele2.setvar2(var2);
Arr.add(ele);
wdContext.node<model>().moveNext();
}
wdContext.node<valuenode>().bind(Arr);
Regards,
Sunitha Hari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all For ur Valuable Comments.
Thanks and Regards
Fazal Ahamed B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Jhansi Miryala is right . pl create one dummy object or element of target node before copying.
If problem solved then award the points and close the thread.
thanks & Regards
Manoj Sahoo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have created the model of webservice using adaptive webservice model, you can use code similar to the one below
SampleModel model = new SampleModel();
// node where inout should be set - say details node
Details input = new Details(model);
//setting input
input.setType(transactionType);
input.setInvoiceNo(String.valueOf(invoiceNo));
input.setEquipmentCode(equipmentCode);
//Creating request object
Request_Details requestObj = new Request_Details(model);
setting the node for input to request object
requestObj.setDetails(input);
//binding request object to original node
wdContext.nodeRequest_Details().bind(requestObj);
// executing model
wdContext.currentRequest_DetailsElement().modelObject().execute();
// invalidating to refresh the data and records acan be fethced from this.
wdContext.nodeResponse_Details().invalidate();
Please note the name of model node and the request and response sub node name. You have to set the input in request node and bind it and execute the same. the structure and name will be different for you.
Hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fazal Ahamed ,
In general WDCopyService is used when you want to copy the values from Model node to Value Node not vice versa. ie., When you are copying data to destination, destination object should be created.
The method WDCopyService.copyElements copies only those attributes from "source" which are present in "target" and if they match (the names equal case-sensitive and the types are compatible).
and your contexts nodes have the same sets of attributes.
In your case you can use the normal code to send the values to back end.
Regards,
Jhansi Miryala
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.