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

ComboBox : Set Default Value and Bind its corresponding fields in a simple form

Hello Experts,

iam using XML Views and Web Ide.

1) we have a combo box which has some values and a simple form below it.

2) when i select value in combo box, its corresponding items/fields are loaded into the simple form.

3) earlier Initial value of the combobox is empty. when i selected a simple value its corresponding fields are loaded into the simpleform.

Requirement :

1) i dont want the initial value of the combobox to be empty. (some how i sorted it out by selected key parameter )

2) i want to capture the initial value and bind the values to the simple form.

Problem :

i could able to see the combobox first value. i want to capture that value and automatically populate the simple form. please suggest upon loading of view how should i catch the first value of combobox and automatically populate its corresponding values in the model.

Thanks

Vaishnavi.

image1.PNG (6.3 kB)
image2.PNG (8.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2016 at 10:51 AM

    Hi,

    Can you post the code here?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2016 at 11:09 AM


    image3.PNG (38.8 kB)
    image4.PNG (15.3 kB)
    image5.PNG (14.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      You can use onBeforeRendering function, get the key and set the model for the form

      onBeforeRendering: function() {

      console.log(this.getView().byId("combobox_id").getSelectedKey());

      //do the same thing here as handelListItemPress function

      },

      Let me know if it works

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2016 at 12:05 PM

    Yaa Its working Thank you so much

    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.