0
votes

Using Grails 1.3.5 and Dojo 1.3.5

class A
{
    B b
}

gsp code...

<g:select name="a.b" from="${B.list()}" optionKey="id"  dojoType="dijit.form.ComboBox" id="someId"/>

grails controller code...

Grails is suposed to bind all the data to my domain class after:

     A a = new A(params)

but, aparently there is some issue with Dojo Combo 'cause the data-binding is NOT working However if I do this instead it works (the data is correctly binded) :

<g:select name="a.b" from="${B.list()}" optionKey="id"/>  
1
Can you post the HTML that's eventually generated from that first g:select? Also, define "not working" - empty ComboBox? No widget? What's (not) happening? - Ken Franqueiro
The comboBox is filled. The problem is in my opinion that Grails cant do data-binding with Dojo Combo Box - David Vargas
<input id="someid" class="dijitReset dijitInputInner" type="text" waistate="haspopup-true,autocomplete-list" wairole="textbox" dojoattachpoint="textbox,focusNode" dojoattachevent="onkeypress:_onKeyPress,compositionend" autocomplete="off" name="a.b" role="textbox" aria-haspopup="true" aria-autocomplete="list" aria-invalid="false" tabindex="0" value="THE VALUE IS PRESENT..."> - David Vargas

1 Answers

0
votes

If you need b.id in controller you can use FilteringSelect:

<g:select name="b" from="${B.list()}" optionKey="id"  dojoType="dijit.form.FilteringSelect" data-dojo-props="name: 'b'" id="someId"/>

In this case you will get params.b == b.id and rest is on your side.

Regards Mateusz