Skip to main content

jMaki and Spring Binding Integration

1 reply [Last post]
krishnag
Offline
Joined: 2008-02-12
Points: 0

Hello,

I have a application developed using Spring MVC. where i have written Spring binding for the HTML form elements as follows

Now i want to replace this text box to jMaki - Yahoo AutoComplete widget
How will i replace value attribute as attribute already exists in widget ??????

Thanks !

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31
Points: 0

Hi,

The format of the autocompleter is the same as the combobox data model:

http://wiki.java.net/bin/view/Projects/jMakiComboxModel

Basically the Autocompleter is going to need to be provide a string like:

[
{ label : 'Alabama', value : 'AL'},
{ label : 'California', value : 'CA'},
{ label : 'New York', value : 'NY', selected : true},
{ label : 'Texas', value : 'TX'}
]

You could create this in the JSP or via a servlet and add it to the wiget using an EL expression.

Assuming you have created a page/request scoped string named "myval" that conforms to the one above you can then have your widget like:

Let me know if this doesn't work for you.

-Greg