This content has been marked as final.
Show 3 replies
-
1. Re: Problem with s:decorator, s:message and cancel button
wark2007 Oct 27, 2008 3:15 PM (in response to wark2007)Sorry, one mistake while preparing a simplified example: I forgot the id for the h:form. So it must look like:
<h:form id="testForm">
-
2. Re: Problem with s:decorator, s:message and cancel button
wark2007 Oct 29, 2008 4:38 PM (in response to wark2007)A short status update. As explained, I guess that the #{invalid} will not be reset when using ajaxSingle="true" instead of immediate="true". I looked at the sources of s:decorator and tried to reset #{invalid} manually by using the following codes in the reset method:
facesMessages.clear(); // Contexts.getEventContext().set("invalid", false); Contexts.getEventContext().remove("invalid");
Unfortunately, it didn't work. Maybe I am completely wrong with my assumptions with #{invalid}?
-
3. Re: Problem with s:decorator, s:message and cancel button
tnl77 Dec 11, 2008 9:39 AM (in response to wark2007)Hi Vassiliy!
I faced with the same problem and it seems that I have solve it.
I also used ajaxSingle = "true" for my cancel button and in the action for this button I called following function with FacesContext.getCurrentInstance().getViewRoot() as argument.
public static void clearInvalidState(UIComponent root) { for (UIComponent component : root.getChildren()) { if (component instanceof EditableValueHolder) { EditableValueHolder valueHolder = (EditableValueHolder)component; valueHolder.setValid(true); } clearInvalidState(component); } }