Skip to Content
author's profile photo Former Member
Former Member

Storing collection of values in Web Dynpro

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

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Aug 02, 2006 at 12:01 PM

    Hi Sujesh,

    You could map the nodes of view1 to central nodes in the component controller and access them from view2.

    Best regards,

    Thomas

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Through Component Controller you can get in second view. Otherwise create one attribute(dropvalue) as vector in component controller and bind into view1 and view2. After selecting values from dropdown in view1 put into dropvalue. In view2 you get from dropvalue.

      First option is best.

      Kind Regrads,

      S.Saravanan.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 12:41 PM

    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 comment
    10|10000 characters needed characters exceeded