-
1. Re: rich:listShuttle rerendering problem selectOneListbox on
nbelaevski Nov 2, 2008 2:59 PM (in response to sansaric)Marcel,
You should define list shuttle converter. -
2. Re: rich:listShuttle rerendering problem selectOneListbox on
sansaric Nov 3, 2008 10:01 AM (in response to sansaric)Thanks,
I will try to define the converter as suggested and didn't realize I needed one for a String property in my bean -
3. Re: rich:listShuttle rerendering problem selectOneListbox on
khaled_288 Nov 3, 2008 12:43 PM (in response to sansaric)try to add a converter for the listShuttle tag.
the converter might be something link this:public class SubscriberConverter implements javax.faces.convert.Converter{ public Object getAsObject(FacesContext context, UIComponent component, String value) { int index = value.indexOf(':'); Subscriber s = new Subscriber(); s.setId(Integer.valueOf(value.substring(0, index))); s.setName(value.substring(index + 1)); return s; } public String getAsString(FacesContext context, UIComponent component, Object value) { Subscriber optionItem= (Subscriber) value; return optionItem.getId() + ":" + optionItem.getName(); } }
-
4. Re: rich:listShuttle rerendering problem selectOneListbox on
sansaric Nov 3, 2008 1:31 PM (in response to sansaric)Very useful example. Thanks to all who responded.
-
5. Re: rich:listShuttle update problem with selectOneListbox
sansaric Nov 4, 2008 3:46 PM (in response to sansaric)I added the converter as suggested in the previous replies and the error originally generated is gone which is great. However, I am trying to use the selectOneListbox (see code snippet below) to update the targetValue list parameter of the listShuttle with a new set of options but is it not happening even though I verified that my actionListener is executing and the list that is bound to the targetValue parameter is getting updated. My backingBean has session scope and contains both the actionListener and the list that drives the targetValue parameter of the listShuttle
Any ideas ?
Thanks in advance for your help.<rich:panel> <h:panelGrid columns="2"> <h:outputText value="Prototype"/> <t:selectOneListbox size="1" value="#{dataHandler.currentId}"> <f:selectItem itemLabel="Photo" itemValue="1" <f:selectItem itemLabel="PC" itemValue="2" <f:selectItem itemLabel="Assembly" itemValue="3" <a4j:support immediate="true" event="onchange" actionListener= "#{dataHandler.updateDependencies}" reRender="NotificationEditorOutputPanel" /> </t:selectOneListbox> </h:panelGrid> <a4j:outputPanel id="NotificationEditorPanel" ajaxRendered="true"> <rich:listShuttle immediate="true" id="NotificationListShuttle" sourceValue="#{dataHandler.availableSubscribers}" targetValue="#{dataEditingHandler.committedSubscribers}" fastOrderControlsVisible="false" orderControlsVisible="false" var="users" sourceCaptionLabel="Available Users" targetCaptionLabel="Currently Subscribed Users"> <rich:column> <h:outputText value="#{users.displayName}"/> </rich:column> </rich:listShuttle> </a4j:outputPanel> </rich:panel>
-
6. Re: rich:listShuttle rerendering problem selectOneListbox on
ilya_shaikovsky Nov 5, 2008 5:20 AM (in response to sansaric)your support is immediate so why you expect that new value will be applied before you trying to add new value using action listener? try to use ajaxSingle instead of immediate.