on 08-24-2008 1:08 PM
I have a commandBean named UpdatePRCommandBean . It has 2 properties 1)headerDTO of type HeaderDTO 2)detailsDTO of type Collection . The bean has an execute method which executes an sql stored procedure . and its expects 2 parameters HeaderDTO and Collection .
While debugging , I can see that Collection object is null , even though the corresponding context node is filled with data (while debugging the data is verified )
The context structure of model nodes is as under
---root
---PRDetailsMainNode
-
PRDetailschildNode(X)
---UpdatePRMainNode
-
UpdatePRchildNode(Y)
Now I want to copy data from X node to Y . I have used following code
wdContext.nodeUpdatePRMainNode().invalidate();
UpdatePRMainNode upd = new UpdatePRMainNode();
wdContext.nodeUpdatePRMainNode().bind(upd);
IPRDetailschildNode srcNode = wdContext.node.nodePRDetailschildNode ();
IUpdatePRchildNode destNode = WdContext.nodeUpdatePRMainNode().nodeupdatePrChildNode();
int size = srcNode.size();
IPrDetailsChildNodeElement elemSrc;
IupdatePrchildnodeElement elemDest;
for (int i = 0; i < size; i++) {
elemSrc = srcNode.getPrDetailsChildNodeElementAt(i);
elemDest = destNode.createupdatePrchildnodeElement (elemSrc.modelObject());
destNode.addElement(elemDest);
WDCopyService.copyCorresponding(elemSrc, elemDest);
}
wdContext
.currentUpdatePRCommandElement()
.modelObject()
.execute_updatePR();
In debug mode , the value gets successfully copied to elemDest . However while debugging commandbean it is seen that the collection object is empty .
Can anyone help ?
HI,
everything seems to be correct, but
you create upd
UpdatePRMainNode upd = new UpdatePRMainNode();
and bind it with
wdContext.nodeUpdatePRMainNode().bind(upd);
then after copying everything into destNode..
you need ti add destnode into upd.
i.e.
like
upd.setUpdatePRchildNode(destnode);
then only your commandbean context will get your copied values. else right now destnode contains value, but it is not added into upd..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
I could not find an API to convert nodeelement to collection . I manually wrote a method in view which took IWDElement as input and return the required DTO . Inside the method , I wrote adding DTO elements through IWDelment .
Collection objet was creted as under
Collection vendorBillDetailsDTO=new ArrayList()
The items in collection weere added as under
vendorBillDetailsDTO.add(ConvertNodeElementToVendorBillDetailsDTO(elemDest));
The method ConvertNodeElementToVendorBillDetailsDTO is as under
public VendorBillDetailsDTO ConvertNodeElementToVendorBillDetailsDTO(IBillDetailsForBillIdElement ne){
VendorBillDetailsDTO dto=new VendorBillDetailsDTO();
dto.setBillDetailRef(ne.getBillDetailRef() );
dto.setBillId(ne.getBillId() );
dto.setCRN(ne.getCRN());
dto.setServiceCode(ne.getServiceCode() );
return dto;
}
If anyone knows api to convert nodeelement values to collection objects ..pl share
Edited by: Narasimha Bhat on Aug 25, 2008 1:30 PM
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.