Hi all,
I have an issue when attempt to verify the value of an inputText control (zoneBand in the example below) when a suggestionbox has populated the value I get a verification error. The code is shown below:
In my JSF page I have the following:
<h:panelGroup> <h:inputText id="zoneBand" binding="#{zoneBandPrefixHandler.userZoneBand}" validator="#{zoneBandHandler.validateExistingZoneBand}" size="15" required="true" style="spacing: 4px; spacing: 4px" /> <rich:suggestionbox id="zoneBandSuggestBox" for="zoneBand" var="zb" suggestionAction="#{zoneBandHandler.autocomplete}" fetchValue="#{zb.description}" border="1" width="250" height="150" nothingLabel="Zone Band not found"> <h:column> <h:outputText value="#{zb.description}" /> </h:column> <rich:column> <h:outputText value="#{StaticData.lobMap[zb.lob]}" /> </rich:column> </rich:suggestionbox> <h:message for="zoneBand" style="color: #f00; vertial-align: top;" /> </h:panelGroup>
class ZoneBandHandler { ... public void validateExistingZoneBand(FacesContext context, UIComponent component, Object value) { ZoneBand existingZoneBand = daoFactory.getZoneBandDAO().selectByZoneBand(value.toString()); if (existingZoneBand == null) throw new ValidatorException(new FacesMessage("Zone Band: " + value.toString() + " does not exist.")); } .. }
16-May-2008 12:57:48 com.sun.faces.lifecycle.RenderResponsePhase execute
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=zoneBandAllocationForm:zoneBand[severity=(INFO 0), summary=(Zone Band: In does not exist.), detail=(Zone Band: In does not exist.)]