Hi,
I have 2 views(View1,View2)
I have rows of 2 dropdowns in a table in View1. I select each of these drop downs in multiple rows and go to view 2. In View2 i need to retrieve all the values from View1. How will i retrieve these values?
Is there any collection kind of thing in Web dynpro??
Any help
regards,
Sujesh
Hi Sujesh,
You could map the nodes of view1 to central nodes in the component controller and access them from view2.
Best regards,
Thomas
Hi,
Let's say you have a context structure as this:
-Root
--TableProperties
---Column1(value attribute bound to your 1st dropdown)
---Column2(value attribute bound to your 2nd dropdown)
Have a context node structure as
-Root
--DataNode
---Value1(value attribute, String)
---Value2(value attribute, String)
Map this to the component controller's context with the same structure.
In the onSelect eventhandler, write something like this:
IPrivate<view name>.IDataNodeElement elem = (IPrivateSDNCompView.IDataNodeElement)wdContext.nodeDataNode().getElementAt(wdContext.nodeTableProperties().getLeadSelection()); if(elem != null){ elem.setValue1(wdContext.nodeTableProperties().currentTablePropertiesElement().getColumn1()); elem.setValue2(wdContext.nodeTableProperties().currentTablePropertiesElement().getColumn2()); } else{ IPrivate<view name>.IDataNodeElement ele = wdContext.nodeDataNode().createDataNodeElement(); elem.setValue1(wdContext.nodeTableProperties().currentTablePropertiesElement().getColumn1()); elem.setValue2(wdContext.nodeTableProperties().currentTablePropertiesElement().getColumn2()); wdContext.nodeDataNode().addElement(ele); }
Add component controller as required controller in view2.
Now from view2, you can access it as
wdThis.wdGet<component name>Controller().wdGetContext().nodeDataNode();
Regards,
Satyajit.
Message was edited by: Satyajit Chakraborty
Add a comment