Reputation: 559
There's a button which only purpose is to call modal panel. How to avoid form submission? Exemplary code:
<a4j:commandButton onclick="Richfaces.showModalPanel('noAccess');"/>
And there's a modal panel definition like below:
<rich:modalPanel id="noAccess" autosized="true" moveable="true" >
<f:facet name="header">
<h:outputText value="Hello!" />
</f:facet>
<p>Some meaningful message.</p>
<a onclick="Richfaces.hideModalPanel('noAccess');" href="#">Close</a>
</rich:modalPanel>
Thing is, clicking a button triggers full processing cycle. I'd like to display modal only, and if possible completely skip submission. Button is located in form and there's no way to move it out. How to avoid submission in that case and do the work on client's side?
Upvotes: 0
Views: 1009
Reputation: 141
You could simply use html button
<button onclick="Richfaces.showModalPanel('noAccess');">Click</button>
Upvotes: 0
Reputation: 7395
Add return false;
at the end of onclick
attribute as below.
<a4j:commandButton onclick="Richfaces.showModalPanel('noAccess');return false;"/>
Upvotes: 1