java - How to detect in JSF when the backing bean method returns -


i need detect when backing bean method returns can execute javascript function. alternatively, calling javascript code directly within java source code helpful. there example of how done?

here, when command button clicked, both action , onclick execute simultaneously. need execute processaftersave after save method in backing bean executes.

<h:commandbutton id="savebutton" value="save" type="submit" action="#{copyscript.save}" onclick="processaftersave();" style="width: 75px;"/> 

just execute js code in result page. if bean action returns same page, need conditionally print piece of js code.

<f:verbatim rendered="#{bean.saved}">     <script>processaftersave();</script> </f:verbatim> 

in combination with

private boolean saved;  public void save() {     // business logic here.     // ...     saved = true; }  public boolean issaved() {     return saved; } 

Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -