cancel
Showing results for 
Search instead for 
Did you mean: 

Advice on Editing of Order

Former Member
0 Kudos

Hi there,

This is my current way of doing editing of an existing order:

1. Search the order and store ALL the data into value node.

2. Transfer all the value node's values into model node. These model node are Context Bound to the UI so that one the click of "Save", all these values will be changed/saved successful.

Any comments on this way of doing? Is the transferring of all the data into value node first then transferring to model node redundant? It is abit troublesome because the node needs to contain lots of data due to the number of fields an Order has.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member185086
Active Contributor
0 Kudos

Hello Jackson

Further u can do

1. Search the order object

2. For Transfer all the value node's values into model node.

//IWDNode source and target

WDCopyService.copyElements(source, target);

3. As you said these model node are Context Bound to the UI so that one the click of "Save", all these values will be changed/saved successful.

We can achieve the same thiing with follow the standard practices that Model and Value Node both should be use for its own concern (for example model node is there for carries the data and provide the data from database ,not for binding the UI Element )

Try to implement both activity (Create and Save ) in one action with uses of the flag (CREATEMODE and EDITMODE)

and since for the cases input will be same (coming from value node) so doesn't need further retrieval of the data for create and edit , and bind these value node attributes to the UI.

Best Regards

Satish Kumar

Former Member
0 Kudos

"WDCopyService.copyElements(source, target);"

To use this to copy every elements from model node to value node, what are the requirement? Do the elements inside needs to have the same name etc?

pravesh_verma
Active Contributor
0 Kudos

Hi Jackson,

Yes you are correct. Not just the names of the attribute of the nodes, but also the complete structure and the attribute datatype should be same.

Check these links for more reference:

https://help.sap.com/javadocs/NW04s/current/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.html

Also you can use:


copyCorresponding(Object source, Object target) 

Where the source and target can be node objects.

I hope this helps you!!

Thanks and Regards,

Pravesh

former_member185086
Active Contributor
0 Kudos

Hi

Yes, Signature should be same

also keep in mind that

* @param source The source node
   * @param target The target node
   * @throws RuntimeException if <code>target</code> is a model node and 
   *    <code>source</code> is <b>not</b> a model node holding the same class.
   */

Best Regards

Satish Kumar

Answers (0)