This content has been marked as final.
Show 3 replies
-
1. Re: how to prevent the form submit when we click on rich:sug
ilya_shaikovsky Dec 3, 2007 7:55 AM (in response to thiagu.m)use ajaxSingle="true" on SB component,
-
2. Re: how to prevent the form submit when we click on rich:sug
thiagu.m Dec 8, 2007 3:44 AM (in response to thiagu.m)Thank you for your replay
Actually i am using that rich:suggestionbox on the rich:modalPanel with some other field.
I need prevent modal panel from closure if the validation inside fails.
This is my code<h:inputText id=�name� value="#{bean.name}" required="true"/> <a4j:outputPanel ajaxRendered="true"> <h:message id="error" for=�name�/> </a4j:outputPanel> <h:inputText id=�country� value="#{bean.country }" required="true"/> <rich:suggestionbox id="sugBox" for="country" tokens=",[" rules="#{suggestionBox.rules}" suggestionAction="#{suggestionBox.autocomplete}" var="result" fetchValue="#{result.text}" > <h:column> <h:outputText value="#{result.text}" /> </h:column> </rich:suggestionbox> <a4j:outputPanel ajaxRendered="true"> <h:message id="error1" for=�country�/> </a4j:outputPanel> <a4j:commandLink value="click" oncomplete="windowclose();" reRender="test" /> </h:form> </rich:modalPanel> <script type="text/javascript"> function windowclose() { if (document.getElementById('mpform:error')==null) if (document.getElementById('mpform:error1')==null) { Richfaces.hideModalPanel('_panel'); }; }; </script>
so when i click on suggestionbox it always shows the validation errors
any one help me
By
Thiagu.m -
3. Re: how to prevent the form submit when we click on rich:sug
thiagu.m Dec 8, 2007 3:47 AM (in response to thiagu.m)Thank you for your replay
Actually i am using that rich:suggestionbox on the rich:modalPanel with some other field.
I need prevent modal panel from closure if the validation inside fails.
This is my code<a href="javascript:Richfaces.showModalPanel('_panel',{left:'auto', top:'auto'})"> Show Modal Panel</a> <rich:modalPanel id="_panel"> <f:facet name="header"> <h:outputText value="test"/> </f:facet> <h:form id="mpform"> <h:inputText id=�name� value="#{bean.name}" required="true"/> <a4j:outputPanel ajaxRendered="true"> <h:message id="error" for=�name�/> </a4j:outputPanel> <h:inputText id=�country� value="#{bean.country }" required="true"/> <rich:suggestionbox id="sugBox" ajaxSingle="true" for="country" tokens=",[" rules="#{suggestionBox.rules}" suggestionAction="#{suggestionBox.autocomplete}" var="result" fetchValue="#{result.text}" > <h:column> <h:outputText value="#{result.text}" /> </h:column> </rich:suggestionbox> <a4j:outputPanel ajaxRendered="true"> <h:message id="error1" for=�country�/> </a4j:outputPanel> <a4j:commandLink value="click" oncomplete="windowclose();" reRender="test" /> </h:form> </rich:modalPanel> <script type="text/javascript"> function windowclose() { if (document.getElementById('mpform:error')==null) if (document.getElementById('mpform:error1')==null) { Richfaces.hideModalPanel('_panel'); }; }; </script>
so when i click on suggestionbox it always shows the validation errors
any one help me
By
Thiagu.m