Attribute <required="true"> doesn't work in Ajax4Jsf 1.0.4
Here is the snippet where Attribute <required="true"> doesn't work using Ajax4Jsf 1.0.4, Facelets 1.1.12, MyFaces 1.1.14
<h:form id="manufacturer">
<h:panelGrid columns="3" styleClass="detail" columnClasses="label">
<h:outputText value="Manufacturer" />
<h:selectOneMenu id="manufList" value="#{manufacturerBean.selectedManufacturer}" styleClass="dropdown">
<f:selectItem itemLabel="New" itemValue="New" />
<f:selectItems value="#{manufacturerBean.manufacturerList}" />
<a4j:support action="#{manufacturerBean.loadManufacturerDetails}" event="onchange" reRender="t2,t3,t4,t5" />
</h:selectOneMenu>
</h:panelGrid>
<a4j:outputPanel>
<h:panelGrid columns="3" styleClass="detail" columnClasses="label">
<h:outputText value="Name" />
<h:inputText id="t3" value="#{manufacturerBean.name}"/>
<h:message id="nameError" for="t3" style="color: red; text-decoration: overline" />
<h:outputText value="Description" />
<h:inputText id="t4" value="#{manufacturerBean.description}" />
<h:message id="descriptionError" for="t4" style="color: red; text-decoration: overline" />
<h:outputText value="Archive" />
<h:selectBooleanCheckbox id="t5" value="#{manufacturerBean.archive}" />
<h:message id="archiveError" for="t5" style="color: red; text-decoration: overline" />
</h:panelGrid>
</a4j:outputPanel>
<h:panelGroup>
<h:commandButton id="saveUpdate" value="Save" action="#{manufacturerBean.saveOrUpdate}" />
<h:commandButton id="delete" value="Delete" action="#{manufacturerBean.deleteManufacturer}" />
<h:commandButton id="cancel" value="Cancel" action="cancel" immediate="true" id="cancel" styleClass="button"/>
</h:panelGroup>
</h:form>
# 1
Here is some more info
I am using Log4J and it doesnt report any errors. Here is the stack trace
INFO: Server startup in 8265 ms
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/ajax4jsf.jar!/META-INF/a4j.taglib.xml
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
Jan 25, 2007 1:33:09 PM com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-5.5.17/webapps/namsManufacturer/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
Hibernate: select manufactur0_.ID as col_0_0_, manufactur0_.NAME as col_1_0_ from Manufacturer manufactur0_
Also the moment i add the attribute required="true" it breaks the functionality of other dropdown i.e. h:selectOneMenu onchange event will never fire in case i pick exsisting item from the drop down
But if i add new record without entering the text for Name field then required=true attribute works perfectly by displaying error message and the same screen continues to stay on even if i pick other items from the dropdown subsequently
Any pointers/suggestions will be highly appreciated
Regards
Bansi