suggestionbox triggering validation before a4j:support
mthaxmiller Mar 23, 2009 12:39 PMI have a problem in that I need to call a4j:support from a suggestionbox
but the validation is triggered before the a4j:support request can be
called. I have tried the various suggestions in other posts
(ajaxSingle="true" and renderRegionOnly="false" in the a4j:region) but
no luck. Richfaces is 3.2.2. This is in a modal panel.
Here is the code:
<a4j:region>
<tr>
<td align="left">
<h:selectOneMenu name="workSkillDescCombo"
id="workSkillCodeCombo" label="Work Skill Description"
value="#{MilitaryBean.occupation.workSkill.value}"
required="true" requiredMessage="Work Skill Code: Value is required.">
<f:selectItems value="#{CodeCacheBean.getASICodes$['ONETCODE'][true]}"/>
<a4j:support ajaxSingle="true" event="onchange"
actionListener="#{MilitaryBean.getIndustry}" reRender="militaryIndustry"/>
</h:selectOneMenu>
<h:inputText onkeypress="return event.keyCode!=13"
id="workSkillSearch" maxlength="15" size="15" styleClass="stdTextUp"
value="#{MilitaryBean.workSkillSearch}"/>
<rich:suggestionbox height="120" width="400" usingSuggestObjects="true"
suggestionAction="#{CodeCacheBean.getSearchedCodes}"
var="ws" for="workSkillSearch" fetchValue="#{ws.code.value}"
id="suggestion2" tokens=","
minChars="3" nothingLabel="No Matches" zindex="5000" ajaxSingle="true">
<f:param name="codeName" value="ONETCODE"/>
<h:column>
<h:outputText value="#{ws.code.value}" styleClass="stdLabelNoPad"/>
</h:column>
<h:column>
<h:outputText value="#{ws.descriptionPreSearchValue}"
styleClass="stdLabelNoPad"/><h:outputText value="#{ws.searchValue}"
styleClass="stdLabelRedNoPad"/><h:outputText
value="#{ws.descriptionPostSearchValue}" styleClass="stdLabelNoPad"/>
</h:column>
<a4j:support event="onselect" ajajaxSingle="true"
actionListener="#{MilitaryBean.getIndustry}"
reRender="workSkillCodeCombo, militaryIndustry, workSkillSearch"/>
</rich:suggestionbox>
</td>
</tr>
<tr>
<td align="left">
<h:selectOneMenu id="militaryIndustry" label="Military Industry"
disabled="true" value="#{MilitaryBean.occupation.industry.value}">
<f:selectItems value="${MilitaryBean.industry}"/>
</h:selectOneMenu>
</td>
</tr>
</a4j:region>