cancel
Showing results for 
Search instead for 
Did you mean: 

Context Binding when getting data from 2 models

Former Member
0 Kudos

Hi,

I have a WD application which has 2 views. The first view has 2 Drop downs (A and B), which are populated from a backend Model Call. So this is the selection screen.

When the user selects a value in the drop down, this value os to be retrived and sent to the back end to execute a second model. This second model supplies back the data that is displayed ina Table in the second view.

In the View context of the first View,

I have declared 2 nodes for the 2 drop downs. These 2 nodes are bound to the corresponding nodes of the controller which is turn is bound to the nodes of the first model. This works fine.

I have to send the values selected by the user in the dropdowns A and B, back to the second model.

Now my question is do I create a second set of nodes for A and B in the First View and the controller to interact with the second model ?

If yes then how do I fill this second set of node elements from the user selection ?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Map the required values(inputs to second model) to Controller context from the first view context.

Don't execute the second model during the initialization of the application. Instead create a method in component controller. This controller will have all the required logic to execute BAPI/RFC. Call this method from the wdDoInit() of the second view. By the time wdDoInit() of second view is called, controller will have the required inputs for the second model.

If you have any problems, come back with how you are executing your models

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kranthi,

Thanks for ur response.

I have a custom controller . Do I need a component controller for this?

Secondly the 2 Input nodes in the Controller are mapped to the First Model. So do I need to create additional 2 nodes in the controller and map them to the second model?

The additional 2 nodes I can fill from the first 2 nodes that View 1 will fill ...

Is this what ur implying ?

Thanks

Former Member
0 Kudos

> I have a custom controller . Do I need a component

> controller for this?

Component Controller is special a custom controller.

You can define method to execute second model in either of them.

>

> Secondly the 2 Input nodes in the Controller are

> mapped to the First Model. So do I need to create

> additional 2 nodes in the controller and map them to

> the second model?

Not really. You only need to map node(or values) that are generated from first model and required as input to second model.

> The additional 2 nodes I can fill from the first 2

> nodes that View 1 will fill ...

>

> Is this what ur implying ?

I am sorry, I don't understand above line.

Still out of luck? Come back with the relevant code snippets and steps you followed.