java - JSF bean URLAction gets called everytime -
@named @requestscoped @urlmapping(id = "unblock", pattern = "/unblock", viewid = "/unblock.xhtml") public class unblock { @urlaction public void load(){ //initialize values.. } public void sendrequest(){ } and in xhtml file;
<h:commandbutton id="submit action="#{unblockaccount.sendrequest}" now when first time page loads load method gets called correctly, when click submit button on page , call "sendrequest" method, load method gets called again.
how can stop this? tried use @viewscope didnt help
add onpostback=false @urlaction stop action being called on postback.
a post request initiated on jsf view after fresh request view
@urlaction(onpostback=false) public void load(){ //initialize values.. }
Comments
Post a Comment