javabeans - JSF backing bean triggered when not called -
this question has answer here:
i have button in .xhtml:
<p:commandbutton id="opendialog" value="#{msg.createmultiple}" onclick="pf('dialoglocations').show();" title="view" type="button"> </p:commandbutton> what supposed do, open dialog dialoglocations has next code:
<p:dialog header="#{msg.createmultiple}" id="dialoglocations" widgetvar="dialoglocations" modal="true"closable="true" dynamic="true" closeonescape="true"> <h:form> <p:commandbutton id="acceptmultiple_button" value="#{msg.create}" action="#{locationcreatebean.createmultiple(true)}" styleclass="btn-green internal-margin-left" update="@form"> </p:commandbutton> <p:commandbutton id="cancelmultiple_button" styleclass="btn-red internal-margin-left" onclick="pf('dialoglocations').hide();" value="#{msg.cancel}" title="view" type="button"> </p:commandbutton> </div> </h:panelgroup> </h:form> </p:dialog> the dialog has inputs use in bean.
my problem that, when click button "opendialog" dialog opens , method locationbean.createmultiple(true) being called, action of button "acceptmultiple_button" .
shouldn't action of button triggered when click button?
thanks.
solved it. comment on xhtml surrounded <!-- --> has call method. thought in comment wouldn't call function. seems calls comment anyway.
thanks comments.
Comments
Post a Comment