-
1. Re: SelectOneListBox strange behavior
francisco.affonso Jul 10, 2009 5:12 PM (in response to yasudevil)Hi Diego,
try something like:
<h:selectOneListbox id="someSelect"> <s:selectItems value="#{user.cars}" var="_car" label="#{_car.name}" itemValue="#{_child}"/> </h:selectOneListbox>
<a4j:commandLink reRender="someSelect" action"#{myAction.addCar}"> <a4j:commandLink reRender="someSelect" action"#{myAction.removeCar}">
-
2. Re: SelectOneListBox strange behavior
yasudevil Jul 10, 2009 7:24 PM (in response to yasudevil)Hi Francisco,
I tried that and I have the exact same behavior.
I was thinking if it was possible that on reRender time the selected object was not removed from the collection.
But, if that is the case for what reason when I add a object the field is updated correctly.
-
3. Re: SelectOneListBox strange behavior
yasudevil Jul 10, 2009 9:32 PM (in response to yasudevil)I've just realized that the combo isn't auto updated because I'm selecting one of the fields of my Select.
Is there any option that I can force the reRender? It may be a desired behavior in some cases but for this one it's really annoying.
-
4. Re: SelectOneListBox strange behavior
roanbrasil Jul 24, 2009 3:40 PM (in response to yasudevil)Francisco,
I am having a problem with a4j. I am getting 'A4J' is undefined.
-
5. Re: SelectOneListBox strange behavior
jamesjmp Jul 24, 2009 4:10 PM (in response to yasudevil)Roan, check that you have defined a4j in your page composition
For example:<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">
Maybe you have
xmlns:a="http://richfaces.org/a4j"
instead of
xmlns:a4j="http://richfaces.org/a4j"
-
6. Re: SelectOneListBox strange behavior
jamesjmp Jul 24, 2009 4:16 PM (in response to yasudevil)Diego, to force a rerender when you select one of your items try this:
<h:selectOneListbox id="someSelect"> <s:selectItems value="#{user.cars}" var="_car" label="#{_car.name}" itemValue="#{_child}"/> <a4j:support event="onchange" reRender="someSelect" ajaxSingle="true" /> </h:selectOneListbox>
Good luck!