cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Can you post the code here?

Answers (2)

Answers (2)

Former Member
0 Kudos

Yaa Its working Thank you so much

Former Member
0 Kudos

please mark the answer as correct...

Former Member
0 Kudos
Former Member
0 Kudos

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