cancel
Showing results for 
Search instead for 
Did you mean: 

Model node with Child node

david_palafox
Explorer
0 Kudos

Hi,

In a WebDynpro app, I need to both save and retrieve data to and from DB using models. That info is to be shown on a table which can be edited in terms of adding or deleting rows, and that's where the saving and retrieving info comes in.

We have two Model Nodes, one used to save the info (Request), the other used to retrieve the info (Response) -both by WebServices- and a Value Node to store the retrieved data in, which is then mapped to a similar Node on the View's context. Structure the ComponentController Value Node and the Model Nodes are similar to this (there's more attributes, but for example purposes, these will do)::

- NodeA (parent node) | - NodeB (child node) | | - ChildName | | - ChildLastName | - ParentName | - ParentLastName

Value NodeA: Request Model NodeA: Response Model NodeA:

Col. Card. 0...n 0...n 0...n

Sel. Card. 0...1 0...1 0...1

Singleton true true true

Value NodeB: Request Model NodeB: Response Model NodeB:

Col. Card. 0...n 0...n 0...n

Sel. Card. 0...1 0...1 0...1

Singleton false true true

So basically, the only difference is that the singleton property for the Value NodeB is set to false.

As far as process, data is entered in the Value Node via a table in the View, then it is saved on the DB using the Request Model Node, if you choose to exit the view without completing the task, and enter it again, the info should be retrieved from the DB to the Response Model Node and copied to the Value Node, to be shown on the same table on the View, again, modifiable and saveable to do the same thing.

Here's the interesting part. We're using templates for both saving and retrieving info, and as noted before, ValueNodeB IS NOT singleton, but RequestModelNodeB IS, however, saving the info works fine and you can see the actual data sotred on the DB on the Database Development perspective. Also applying a template to retrieve the data doesn't seem to work though, I'm able to get the elements on the Parent Node, but have not been able to get anything to show on the Child Node.

Using the WS Navigator, we determined that both WS work fine as well, specifically the one that retrieves data DOES show the information for the Child Nodes. So that's not the problem. We believe that somehow in the execution of the WS from the WD using the template, the information might not even be reaching the Model Object.

Any info on this will be greatly appreciated. I will work on posting some sample code that we have so that you guys can have a better idea of what we are trying to do.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi David,

Yes i am telling the same thing. You can also try this code at each controller to check at what point the value is not coming. You may found the problem.

wdComponentAPI.getMessageManager.reportSuccess(wdContext.nodemodelnodeB.currentmodemodelnodeBelement.getChildName());

Regards.

Vivek

david_palafox
Explorer
0 Kudos

Vivek,

Again, thanks for responding and sorry for taking so long to reply. We already did what you suggest and we can't figure out where the information is being lost. We even started to think that the structure of the nodes itself might be wrong or something, but that wouldn't make that much sense because we are able to save the data, the retrieval is the problem.

Thanks again.

Former Member
0 Kudos

Hi David,

Since you are saving and retrieving the same data and binding with the same context to show it in the table UI element using different model node so may be binding is not working properly. You can try this : do not use context binding for saving your data you can just send all the value through code also as the parameter for the save method and while retrieving the code use context binding to show the data in the table of the view. In this way you will not face the inconsistency you are facing now.

I hope that will work,

Regards,

Vivek

david_palafox
Explorer
0 Kudos

Hi Vivek, thanks for your response, and sorry it took me this long to write back, it's been a tough week.

I'm not quite sure I understand your point, but I think I have it set up like you suggest. The only thing bound is a Component Controller Context Node (CN) to a View Context Node(VN). When you save the data, the information on the CN is sent through code to the model node, and then the saving routine is executed. When you retrieve data, it first goes to the model node, then, again using code, that information is copied to the CN.

If this is not what you meant, I'd appreciate further comments.

Thanks.