-
1. Re: a4j commandbutton render attribute does not work when using immediate="true"
lfryc Apr 6, 2011 5:04 AM (in response to mano.swerts)Hi Mano, I have checked and @render works fine with @immediate=true.
What version of RichFaces 4 are you using, could you upgrade to 4.0.0.Final?
Could you provide more details about page and beans?
-
2. a4j commandbutton render attribute does not work when using immediate="true"
mano.swerts Apr 8, 2011 5:40 AM (in response to lfryc)Hi Lukás,
I am using RichFaces 4 Final. I will investigate a little more and get back to you.
Thanks.
-
3. Re: a4j commandbutton render attribute does not work when using immediate="true"
mano.swerts Apr 11, 2011 6:22 AM (in response to mano.swerts)Hi Lukás,
I investigated this a little bit more. My problem is as follows:
I have a page with a simple backing bean which is annotated with @ViewScoped. I have simple form with a couple of fields which is backed by a POJO through said backing bean. One of the properties of this POJO is annotated with @Max(value=9). I use a rich:message component to show an error message next to the field when a number greater than 9 is entered.
{code:java} @Controller
@ViewScoped
public class PojoBean {
private Pojo newPojo = new Pojo();
// ... getters and setters ...
public void saveNewPojo() {
// persist
}
public void resetNewPojo() {
newPojo = new Pojo();
}
}
{code}{code:java}
public class Pojo {
@Max(value=9)
private int property;
// ...getters and setters...
}
{code}
When I enter the number 20 in the text field and hit the tab key, then the error message pops up next to the field. This is ok. After that I hit my cancel button. This button is bound to a reset action. It looks like this in the xhtml code:
{code:xml}
<a:outputPanel id="createNewPojo">
<h:form>
<h:inputText id="property" label="Property" value="#{pojoBean.property}">
<rich:validator />
</h:inputText>
<rich:message for="property" />
<a:commandButton id="savePojo" value="save" action="#{pojoBean.saveNewPojo}" />
<a:commandButton value="reset" action="#{pojoBean.resetNewPojo} immediate="true" render="createNewPojo" />
</h:form>
</outputPanel>
{code}
The problem is that when I hit the reset It does not rerender my form. It reset the pojo correctly and the error message disappears like it should thanks to the immediate propery, but the number 20 remains in the text field. Even when there is no validation error, the number remains in the text field. When I remove the immediate property, the value for the property is removed from the text field. So my conclusion from this is that the rerender doesn't occur.
Am I trying to tackle this problem in the wrong way?
Thanks in advance.
-
5. Re: a4j commandbutton render attribute does not work when using immediate="true"
ilya_shaikovsky Apr 18, 2011 6:19 AM (in response to ilya_shaikovsky)think that easier solution will be to remove immediate and use ajaxSingle for cancel instead.