Skip to Content

How to Pass Input Parameter from Object Page?

Hello All,

I am using below link as an example,

The input field is available in Simple form,

So When user give some value,How can I pass Value of Input field to my controller , so that I can send it Backend?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Oct 16, 2018 at 12:19 PM

    Hi Sujoy,

    Oh i get it now :).

    Try this:

    var sValue = this.getView().byId(this.getView().byId(<blockid>).getAssociation("selectedView") + "--" + <your control id>).getValue();
    in my case the control id is "Input" and block id is jobinfo
    var sValue = this.getView().byId(this.getView().byId("jobinfo").getAssociation("selectedView") + "--" + Input).getValue();

    In the example you shared Block ID is available in ObjectPageFormLayout.view.xml

    The cleaner way of doing this is by using models.

    check this example, much better:

    Hope it helps.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2018 at 11:29 AM


    You can do it multiple ways:

    Assign an id to your input control in the view and you can read the value in your controller as below:

    In View:
    <Input id="yourControlID" ......></Input>
    Controller Code:

    Check documentation:

    You can also try binding a model to your simple form and bind a property to your input field.

    As and when you enter the value in the input field, you model is updated and you can read the data by accessing the model in your controller.

    Example with JSON Model: (use getData method to read model data).

    I quickly checked the example you are referring to, there is no model being used.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hello Vinod,

      Thanks for the reply,

      I have already tried this.

      In View:<Inputid="yourControlID" ......></Input>
      Controller Code:

      Problem is - Input field is another view and it is Simple form.(It is not part of Main view)

      So When Save button is press, onSave action is triggered in Controller

      this.getView().byId("<yourControlID>").getValue(); is getting failed.

      Any Idea How we can get that?

  • Posted on Oct 16, 2018 at 02:38 PM

    You missed double quotes: try this.

    var sValue = this.getView().byId(this.getView().byId("jobinfo").getAssociation("selectedView") + "--" + "STREETADDRESS1").getValue();



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 25, 2018 at 09:00 AM

    Hello Vinod Kumar Kannappa,

    I have one Question regarding how to trigger controller here,


    <Input value=" " maxLength="8" width="200px" showValueHelp="true" valueHelpRequest="onSearch/>

    So how to trigger onSearch event in controller?

    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.