Page 1 of 1

standard value select box (query)

Posted: Wed Aug 07, 2013 4:37 pm
by Fabian Unruh

how can i set a standard value of a select box that gets its values from a query?


standard value select box (query)

Posted: Wed Aug 07, 2013 5:23 pm
by Oleg Danchenkov

I'm not sure I understand you. Could you please clarify (some examples or screenshots could help).


standard value select box (query)

Posted: Wed Aug 07, 2013 9:08 pm
by Fabian Unruh

Image

the select box "kanton wählen" shows a query with all cantons of switzerland. i want the standard value to be "kanton wählen" instead of the first canton of the query.


standard value select box (query)

Posted: Thu Aug 08, 2013 6:46 am
by Anton Artyukh5836028

Hello,

You can set default value in Success-event action for service by using JS-code or setting property for selectmenu component.


standard value select box (query)

Posted: Thu Aug 08, 2013 1:11 pm
by Fabian Unruh

what would the js code be and what do you mean by success-event action?


standard value select box (query)

Posted: Thu Aug 08, 2013 3:38 pm
by maxkatz

standard value select box (query)

Posted: Thu Aug 08, 2013 4:36 pm
by Fabian Unruh

like this?

onSuccess': function(data) {return "default value";}

i'm not sure if that does the trick. i would like to display the default value as the first value in my select box. after that the query-result should follow.


standard value select box (query)

Posted: Thu Aug 08, 2013 9:06 pm
by Fabian Unruh

like this?

onSuccess': function(data) {return "default value";}

i'm not sure if that does the trick. i would like to display the default value as the first value in my select box. after that the query-result should follow.


standard value select box (query)

Posted: Thu Aug 08, 2013 9:20 pm
by maxkatz

You would need to access the component.. and set its value.


standard value select box (query)

Posted: Tue Sep 17, 2013 1:32 pm
by Kateryna Grynko

Dear Fabian,

We are sorry, we lost the topic due to a technical problem.
Here is a general solution (see code for Success method below):
codereturn {
'field' : data.field '',
'field1' : data.filed1 0,
...
}/code