Call a JSF method -
when user clicks testscript button, method testscript should called. calls different method in bean. following sample code.
<h:form id="myform"> <h:commandbutton id="testscript" actionlistener="# {scriptedpolicybean.testscript"} /> <feat:button onclick="document.getelementbyid("myform:testscript")" /> </h:form>
please help
doing onclick="getelementbyid" nothing gets id. button , not "return false;" form submitted feat button (if has type submit on rendered page). of course in case actionlistener of other button not called @ (as has nothing form submit).
you should call click method on testscript button this: onclick="document.getelementbyid('myform:testscript').click();".
it nice have simple <input type="button" /> instead of feat:button sure submit not called element.
Comments
Post a Comment