How to use Primefaces' p:growl and redirect to a page

后端 未结 3 888
忘了有多久
忘了有多久 2020-12-06 10:21

hi im kind of new at jsf enviroment, im trying to update a primefaces growl and then redirect to a page from a commandButton action.

 

        
3条回答
  •  情话喂你
    2020-12-06 11:26

    Because Flash has bug, my solution is to make a separated redirect button which will be hit after showing msg:

    HTML:

    
        
        

    Bean:

    public void process(){
        addInfoMsg(summary, msgDetail); //Add msg func
        RequestContext.getCurrentInstance().execute("setTimeout(function(){ $('#rdr-btn').click(); }, 3000);"); // 3 seconds delay. I put the script in Constants to config later.
    }
    

提交回复
热议问题