Reputation: 3581
As we all know, javax.swing.JComboBox
is a dropdown selection having E
elements in it. When setting .setEditable(true)
, we now can make that JComboBox
also a JTextField
for other E
element.
After searching with Google
on this, it returned to us a suggestion of using by JQuery about autocomplete presented here. Autocomplete is working on the selection but here's the problem, we need to trigger the onChange
attribute that contains the ${remoteFunction}
to render a particular template on the update
attribute of the said ${remoteFunction}
.
<g:select
id="itemSelectId"
onChange="${remoteFunction(
controller:'item', action:'itemSelect',
update:[success:'updateItemId'],
params:'\'id=\' + escape(this.value)'"/>
<div id="updateItemId></div>
And on the <script>
provided on the link we just change #combobox
to #itemSelectId
.
Upvotes: 2
Views: 968