-
1. Re: Extended Selection
ilya_shaikovsky Jul 22, 2009 4:02 AM (in response to netdrag)only suggestion box could be used as you described. But it's works with an input not select actually so you need to read about the ways to submit additional properties of object like id instead of label when using it. Visit dev guide and richfaces-demo to check.
-
2. Re: Extended Selection
netdrag Jul 22, 2009 11:01 AM (in response to netdrag)Thank you, with your hint I was able to write
<s:decorate template="layout/edit.xhtml" rendered="#{not empty applicationUserList.resultList}"> <ui:define name="label">Assignee</ui:define> <a:outputPanel> <h:inputText id="assignee" immediate="false"> <rich:suggestionbox id="assigneesuggestion" for="assignee" suggestionAction="#{applicationUserList.findByName}" var="_assignee" fetchValue="#{_assignee.username}" nothingLabel="No Users found" > <h:column>#{_assignee.firstname} #{_assignee.middlename} #{_assignee.lastname}</h:column> <h:column>#{_assignee.username}</h:column> <a:support event="onselect" ajaxSingle="true"> <f:setPropertyActionListener value="#{_assignee}" target="#{invoiceHome.instance.assignee}" /> </a:support> </rich:suggestionbox> </h:inputText> </a:outputPanel> </s:decorate>
which works as aspected and saves the value in the database.
But I forgot one thing, now it isn't able to load values form the bean. and when I add value="#{invoiceHome.instance.assignee}" to the input, I get problems with the converter...
Have you another hint for me?
Thanks or your help -
3. Re: Extended Selection
netdrag Jul 22, 2009 2:18 PM (in response to netdrag)I don't think its possible to do what I wanted to do with richfaces.
Are there any plans to extend suggestionbox in this way, or better implement this as a new component? -
4. Re: Extended Selection
ilya_shaikovsky Jul 23, 2009 5:43 AM (in response to netdrag)when I add value="#{invoiceHome.instance.assignee}" to the input, I get problems with the converter...
And I'm wondering how the converter for your object which you have to to attach to input related to RF? -
5. Re: Extended Selection
netdrag Jul 23, 2009 7:10 AM (in response to netdrag)Oh sorry I wasn't clear.
I have no converter, so it is complaining about: summary=(Conversion Error setting value 'asdf' for 'null Converter'.)
Because there is no converter to convert a stringvalue to a company object.
If I use a converter it would interfere with the propertyactionlistener and overwrite the id I saved in the bean, wouldn't it? -
6. Re: Extended Selection
netdrag Aug 1, 2009 1:31 PM (in response to netdrag)I tried different ideas but didn't fount a usable solution that works on loading and saving the value.
using a converter on the textbox overwrites what I save into the entity with the propertyactionlistener.
So is it worth creating a feature request for a select component with extendend information on open drop down? I think its a fast and good solution for selecting a single object from a long list of possibilities, for example selecting a product from a large list of products with different characteristics.
anyone else needing something like that or thinking its a good idea? -
-