Hi,

I'm using MyFaces 1.1.6 with Tomahawk 1.1.7 running on WebLogic 9.2.2 (JDK
1.5).  

I have this calendar component:

                                        <t:inputCalendar id="dateFrom"
value="#{SearchBean.fromDate}" helpText="mm-dd-yyyy" renderAsPopup="true"
renderPopupButtonAsImage="true">
                                                <f:convertDateTime
type="date" pattern="MM-dd-yyyy"/>
                                        </t:inputCalendar>

The default text displayed is "mm-dd-yyyy", however, this is not a valid
date, so if the user submits the form, I'd expect to return to my same
search form, with the error message.  But this is not happening.  How can I
force validation to occur?  Below is the complete JSF search form.  Let me
know if I need to provide more.

Thanks, - Dave



                <div id="searchForm" dojoType="dijit.layout.ContentPane"
layoutAlign="top">
                        <h:messages showSummary="true" 
showDetail="true"></h:messages> 
                        <h:form id="SearchForm" onSubmit="return search();">
                        <table border="0.25" cellspacing="0" cellpadding="5" 
align="center"
bordercolor="#000066">
                            <tr >
                              <td bgcolor="#E9E9E9" class="text_label" 
colspan="2">
                                <div align="center">Search</div>                
                
                              </td>
                            </tr>
                            <tr >
                              <td bgcolor="#990000" colspan="2" height="1px;">
                                                <div align="center" 
height="1px;"></div>
                              </td>
                            </tr>
                            <tr bgcolor="#E9E9E9">
                              <td class="text_label" align="right"> 
                                   <h:outputText styleClass="requiredElement" 
value="*" />
<h:outputText value="Key Type:" />
                                  </td>
                                  <td class="text_descr" align="left">
                                        <h:selectOneListbox 
id="applicationSelect" size="1"
                                                value="#{SearchBean.keyType}"
                                                immediate="true">
                                                <f:selectItems 
value="#{SearchBean.keyTypes}"/>
                                        </h:selectOneListbox>
                              </td>      
                            </tr>
                            <tr bgcolor="#E9E9E9">
                              <td class="text_label" align="right"> 
                                   <h:outputText styleClass="requiredElement" 
value="*" />
<h:outputText value="Key Value:" />
                                  </td>
                                  <td class="text_descr" align="left">
                                        <h:inputText id="keyValue" 
value="#{SearchBean.keyValue}"
required="true" />      
                              </td>      
                            </tr>
                            <tr bgcolor="#E9E9E9">
                                <td class="text_label" 
align="right"><h:outputText value="From:" /></td>
                                <td class="text_descr" align="left">
                                        <t:inputCalendar id="dateFrom" 
value="#{SearchBean.fromDate}"
helpText="mm-dd-yyyy" renderAsPopup="true" renderPopupButtonAsImage="true">
                                                <f:convertDateTime type="date" 
pattern="MM-dd-yyyy"/>
                                        </t:inputCalendar>
                                </td>      
                            </tr>
                            <tr bgcolor="#E9E9E9">
                              <td class="text_label" 
align="right"><h:outputText value="Through:"
/></td>
                                <td class="text_descr" align="left">
                                        <t:inputCalendar id="dateThrough" 
value="#{SearchBean.throughDate}"
helpText="mm-dd-yyyy" renderAsPopup="true" renderPopupButtonAsImage="true">
                                                <f:convertDateTime type="date" 
pattern="MM-dd-yyyy"/>
                                        </t:inputCalendar>
                                </td>      
                            </tr>
                            <tr bgcolor="#E9E9E9">
                              <td colspan="2" align="center">
                                <h:commandButton value="Submit" 
styleClass="npsButton"
                                        onmouseover="hoverGridButton(this)"
                                                
onmouseout="unhoverGridButton(this)" />
                              </td>
                            </tr>
                          </table>
                        </h:form>
                </div>

-- 
View this message in context: 
http://www.nabble.com/Validating-calendar-input-tp19801596p19801596.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to