[
https://issues.apache.org/jira/browse/WICKET-1328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12576636#action_12576636
]
Michael Mehrle commented on WICKET-1328:
----------------------------------------
Thanks for looking at this. The offered solution should work for me - the
Converter can then connect to the appropriate service (or a simple list of
detached domain objects) to retrieve and return the POJO via its id. Thanks!
Michael
> AutoCompleteTextField.getModelObject() needs the means to return an
> underlying collection of POJOs.
> ----------------------------------------------------------------------------------------------------
>
> Key: WICKET-1328
> URL: https://issues.apache.org/jira/browse/WICKET-1328
> Project: Wicket
> Issue Type: New Feature
> Components: wicket-extensions
> Affects Versions: 1.3.0-final
> Environment: Assigning an iterator of POJOs to AutoCompleteTextField
> instead of Strings.
> Reporter: Michael Mehrle
> Priority: Minor
> Original Estimate: 3h
> Remaining Estimate: 3h
>
> When assigning AutoCompleteTextField an iterator of POJOs instead of Strings
> (via the overridden getChoices() method, which returns an Iterator),.
> getModelObject() needs to be able to return POJO instances instead of the
> Strings produced by the custom AutoCompleteTextRenderer.
> This situation arose when I had to feed a list of POJOs into my
> AutoCompleteTextfield - which worked fine after writing a simple subclass of
> AbstractAutoCompleteTextRenderer, which grabbed the POJO's name field for
> screen rendering (the list inside the <div> tag). Problem is that the call to
> getModelObject *seems* to use the text from renderer.getTextValue(), which
> required me to manually match that string to the name fields of the cached
> POJOs. In a preferred scenario getModelObject() would return the object
> references that were fed into getChoices().
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.