If you want to send just one value using a4j and have required
attributes, I strongly recommend using the a4j:region:
<h:form>
<a4j:region>
<h:selectOneMenu>
<a4j:support ajaxSingle="true" event="onchange" ... />
</h:selectOneMenu>
</a4j:region>
<h:inputText required="true" />
</h:form>
What this does is tell A4J only to decode the components in the
submitted region. In this example, only the selectOneMenu will be
decoded, validated and updated (and thus not trigger the required
validation error).
The ajaxSingle is just a performance benefit.
-Andrew
On 6/27/07, bansi <[EMAIL PROTECTED]> wrote:
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}"
[b]required="true"[/b] />
<h:message id="nameError" for="t3" style="color: red; text-decoration:
overline" />
required="true" breaks the functionality of other dropdown i.e.
h:selectOneMenu onchange event will never fire in case i pick a value from
the drop down
Any pointers/suggestions will be highly appreciated
--
View this message in context:
http://www.nabble.com/JSF-Validation-attribute-required%3D%22true%22-doesn%27t-work-tf3989495.html#a11328112
Sent from the MyFaces - Users mailing list archive at Nabble.com.