Problem with successful validation
sam-user Sep 15, 2011 4:33 AMI have a Seam/Richfaces(3.3.1) application.
On one of my pages I have a button, that opens a modalPanel.
On that modal panel I have a rich:Calendar element that's pre-populated with the current date. The element is mandatory, i.e the user has to accept the prepopulated date or select a new valid date.
The problem I have with this is that if the user deletes the value in the field, closes the modalPanel and then opens that panel again, after the calendar field is again populated with the current date, the requiredMessage text dissapears from the panel, but the field is still shown in red. As if the validation worked, but, figuratevely speaking, the rendering stopped in the middle.
Here's the code:
page.xhtml
<ui:define name="body" > <h:form id="ttform" styleClass="edit" > <h:panelGrid columns="1" columnClasses="rich-panel-button-left"> <s:div > <a:commandButton id="btnShow" value="Show" reRender="divPanel" onclick="Richfaces.showModalPanel('mpDate');" /> </s:div> </h:panelGrid> </h:form> <a:log popup="true" level="ALL" style="width: 800px; height: 300px;" rendered="true" /> <f:subview xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <a:outputPanel id="effDatePanel" layout="none"> <rich:modalPanel id="mpDate" width="800" height="400" > <s:div id="divPanel" > <f:facet name="header"> <h:panelGroup> <h:outputText value="Confirm Date"></h:outputText> </h:panelGroup> </f:facet> <f:facet name="controls"> <h:panelGroup> <h:graphicImage value="img/close.PNG" styleClass="hidelink" id="hidelink"/> <rich:componentControl for="mpDate" attachTo="hidelink" operation="hide" event="onclick"/> </h:panelGroup> </f:facet> <h:form id="formDate" styleClass="edit" > <rich:panel id="panDate"> <f:facet name="header">Please confirm the date</f:facet> <s:decorate id="theDate" template="layout/edit.xhtml" > <ui:define name="label"> Date</ui:define> <rich:calendar id="bdate" requiredMessage="Required" required="true" immediate="true" enableManualInput="true" defaultTime="#{currentDate}" currentDate="#{currentDate}" value="#{calBean.selectedDate}" datePattern="dd/MM/yyyy" bypassUpdates="false" ajaxSingle="true"> <a:support event="oninputblur" reRender="theDate" bypassUpdates="true" ajaxSingle="true"/> </rich:calendar> </s:decorate> <div style="clear:both"> <span class="required">*</span> required fields </div> </rich:panel> <a:commandButton id="close" type="reset" reRender="divPanel" value="Close" immediate="true" onclick="Richfaces.hideModalPanel('mpDate');" /> </h:form> </s:div> </rich:modalPanel> </a:outputPanel> </f:subview> </ui:define>
edit.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.com/products/seam/taglib"> <div class="prop"> <s:label styleClass="name #{invalid?'errors':''}"> <ui:insert name="label"/> <s:span styleClass="required" rendered="#{required}">*</s:span> </s:label> <span class="value #{invalid?'errors':''}"> <s:validateAll> <ui:insert/> </s:validateAll> </span> <span class="error"> <h:graphicImage value="/img/error.gif" rendered="#{invalid}" styleClass="errors"/> <s:message styleClass="errors"/> </span> </div> </ui:composition>
I attached the log output and also a screenshot of the modal panel after it's been re-opened.
I'm probably missing something here, but can't find what is it.
Any ideas?
-
screenshot.bmp 231.3 KB
-
log.log.zip 3.5 KB