Skip to Content

[MVC] Call controller with Javascript - How to pass model?


In one of my requirement, I have to pass the main model to a controller that I simply create through Javascript (let's say I call it with : 'http://.../ '); )

How sould I proceed to set an existing model to this controller?

Many thanks in advance.

Best regards,


Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2009 at 10:14 AM


    u might be having a model class for your model,

    just insert that model class in the attributes and then u can use that model class for your controller.

    a easy example of creating it is as in this link...

    [creating controllers with model| ]

    Give the page attributes of the view. in the page attribute define the model class there that u have created.

    in the view u can use the model class as...

    SELECT_model is the name of the object refering to the model class.

    i_vbak have been defined in the attributes of the model class.

    we are accessing it here in teh view calling it as below.

    and in the model we had fetched the data for the below fields .

    <htmlb:tableView id="TV_VBAK" table="//SELECT_model/I_VBAK">

    <htmlb:tableViewColumn columnName="vbeln"></htmlb:tableViewColumn>

    <htmlb:tableViewColumn columnName="ERDAT"></htmlb:tableViewColumn>

    <htmlb:tableViewColumn columnName="ERZET"></htmlb:tableViewColumn>

    <htmlb:tableViewColumn columnName="ERNAM"></htmlb:tableViewColumn>

    <htmlb:tableViewColumn columnName="ANGDT"></htmlb:tableViewColumn>


    i hope it is clear.



    Add a comment
    10|10000 characters needed characters exceeded

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.