GRAILS and DOJO data binding issue
开发者_C百科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"/>
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
精彩评论