cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass values between views??

Former Member
0 Kudos

Hi,

I am new to java webdynpro.So kindly solve my query.

I have 2 views named x and y,

In x i have a inputfield and in y i have a dropdown by key field.

I need to pass the value entered in the input field of view x to the dropdown field's listed values.How can i do that.

both fields are of different simple types.

Thanking you.

Arjun.G

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

check this pdf

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/web-application-se...

and xxxxxxxxxxxxxxxxx

Bala

Edited by: Armin Reichert on Jan 1, 2008 3:43 PM

Former Member
0 Kudos

Hi,

1. Copy context values from x-view to component controller or create the same in component controller.

2. map the x-view values to the component controller.

3. map the component controller values to the y-view.

Now you can access the x-view values in y-view.

amolgupta
Active Contributor
0 Kudos

hi,

there is something called Context Mapping.

you will have to map the context from one one view to another using the component controller in between.

Search "context mapping" u'll get lot of stuff.

its a key concept so try to understand it carefully...

copy the context of first view and paste it in the context of the component controller.Repeat the same for the second view.

Double click on the name of your Component.

the diagram view will open up...

create a data link from each of your views to the component controller.

u will be prompted to map the context. Do it.

when you map the context from a view to the component controller, the view's mapped context loses existenece and shares that of the component controller...

after all this whatever context u mapped will be available in both the views as well as the component controller.

regards,

-Ag.

Former Member
0 Kudos

Dear Arjun,

This is a problem of dynamically filling the list of the dropdown box.

Statically this can be done by creating a simple type and adding to its enumeration.

Dynamically, you do the same thing but you need to write code which goes as follows:

IWDAttributeInfo attributeInfo =

wdContext.getNodeInfo().getAttribute("DropDownFieldContextName");

// DropDownFieldContextName is a context attribute ( could be of string type also) that is bound to the dropdown box at design time.

ISimpleTypeModifiable objType = attributeInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet =

objType.getSVServices().getModifiableSimpleValueSet();

valueSet.put("key","value");

// value could be retreived from a context attribute that contains the string entered in the inputfield in the other view.

Regards,

Mayuresh

PS : xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Edited by: Armin Reichert on Jan 1, 2008 3:42 PM

former_member197348
Active Contributor
0 Kudos

Hi Arjun,

In x,y and Component Controller create context attribute (say db_key) of type dropdown by key field

(Open context tab of y-> right click on dropdown by key field -> Copy

paste this in context of x and Component Controller )

Map them using context mapping (open Navigation modeler -> link view to controller for both x and y -> map attributes)

Depending the value of the inputfield in view x set the db_key.

regards,

Siva