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

Context Binding when getting data from 2 models

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 12:08 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 18, 2005 at 02:19 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      > 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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.