but what good is it if the model is set to null when that entered text is still a valid entry? how does the user then get that entered text? why isnt the text the model?
thats why it is the way it is - working with strings only. -igor On 2/27/07, Jonathan Locke <[EMAIL PROTECTED]> wrote:
i said that. "If it can't find it, the model is set to null." the difference from a "combobox" being that you can find the thing they picked that didn't match with getInput(). this makes it essentially an editable dropdown. igor.vaynberg wrote: > > its a combobox, what if they submit text that is not part of any existing > selection? > > -igor > > > On 2/26/07, Jonathan Locke <[EMAIL PROTECTED]> wrote: >> >> >> >> Don't you think it should work the same as other list selection >> components? >> You give the component a list of objects to choose between using the text >> completion field and when the text is submitted, it sets the model of the >> component to the first object in the list that matches the text. If it >> can't find it, the model is set to null. If the list of objects are in >> sorted order by their text, a binary search can be performed for the >> model >> object. >> >> If the text isn't unique, how is the user going to choose between two >> "Frank >> Johnsons"? I think the text has to be unique to complete like this. >> >> >> Martijn Dashorst wrote: >> > >> > I want to use the ACTF in our projects, but it is not very helpful for >> > selecting objects. Typically the text you display for >> > selecting a person is not very unique or identifying for the object >> > that is associated: "Johnson, Frank" is perfect for display, >> > but is hard to dissect when you have to re-assemble the person on the >> > server side: the ACTF uses a String as the model. >> > >> > I was thinking of a panel with the autocomplete text field which shows >> > the display value, and a hidden field that will hold the ID >> > of the selected object. The hidden field can then be used to fetch the >> > object on the server and assign it to the model object of >> > ObjectAutoCompleteTextField. >> > >> > <wicket:panel> >> > <input type="text" wicket:id="displayvalue" /> >> > <input type="hidden" wicket:id="idvalue" /> >> > </wicket:panel> >> > >> > The OACTF would need to communicate both the selection markup, and the >> > associated ID values that need to be set on the hidden >> > field upon selection. Now I could add a special tag to the selection >> > markup, something like below: >> > >> > <ul> >> > <li choiceid="12341">Johnson, Frank</li> >> > <li choiceid="41231">Miller, Frank</li> >> > </ul> >> > >> > But I imagine other possibilities are available (or using the markup >> > id itself). Can you share your thoughts? >> > >> > Martijn >> > >> > >> > -- >> > Learn Wicket at ApacheCon Europe: http://apachecon.com >> > Join the wicket community at irc.freenode.net: ##wicket >> > Wicket 1.2.5 will keep your server alive. Download Wicket now! >> > http://wicketframework.org >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Object-oriented-AutoCompleteTextField-tf3294592.html#a9175997 >> Sent from the Wicket - Dev mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Object-oriented-AutoCompleteTextField-tf3294592.html#a9185833 Sent from the Wicket - Dev mailing list archive at Nabble.com.
