Hi everyone,
In my page I have two text fields on the model panel, one for username and the second one for country.
I use the rich:suggestionbox component for country field.
I use the model panel field validation, if any of the two fields have validation error. I need to prevent the model panel hide also.
This is my sample coding.
<rich:modalPanel id="reg" height="500" width="700" >
<f:facet name="header">
<h:outputText value="Registration Form" />
</f:facet>
<a:form id="regform" >
<a:region >
<a:outputPanel ajaxRendered="true">
<h:outputLabel for="id">Username *</h:outputLabel>
<h:inputText id="id" value="#{user.siId}"required="true"/>
<h:message for="id" id="id1" style="color:red" />
</a:outputPanel>
<h:outputLabel for="country">Country </h:outputLabel>
<h:inputText value="#{user.country}" id="country" />
<rich:suggestionbox ajaxSingle="true" id="suggestion" for="country" suggestionAction="#{user.autocomplete}" var="result" fetchValue="#{result.text}" >
<h:column>
<h:outputText value="#{result.text}" />
</h:column>
</rich:suggestionbox>
<a:commandButton value="Register" action="#{register.register}" oncomplete="windowclose();"/>
</a:region>
</a:form>
</rich:modalPanel>
<script type="text/javascript">
//<![CDATA[
function windowclose(){
if (document.getElementById('regform: id1')==null)
{
Richfaces.hideModalPanel('reg');
};
};
//]]>
</script>
Here I can not use a:outputPanel over the rich:suggestionbox. Because, if I use the suggestionbox it does not work properly.
In the sample coding above, I get the validation error for the first field whenever I type something in the suggestionbox even if I use ajaxSingle="true" in that component.
Please help me to resolve this issue.