java - My jsf FacesBehavior class reloads the viewscoped bean -


i've facesbehavior class works fine. tag used within .xhtml, every single commandbutton clicked on, results in reinitialisation of viewscoped bean. there way avoid this?

@facesbehavior("confirmbehavior")     public class confirmbehavior extends clientbehaviorbase {     private static final long serialversionuid = 123456l;     @managedproperty(value = "#{render}")     private boolean render = boolean.true;     @managedproperty(value = "#{message}")     private string message;      @override     public string getscript(clientbehaviorcontext behaviorcontext) {         if (render) {             return "return confirm('" + message + "')";         } else {             return null;         }     } //+getters , setters }   <h:commandbutton  title="#{msg.ttunavailableplant}" immediate="true"     image="/resources/img/stop.png"  actionlistener="#{assortiment.markasunavailable}"> <an:confirm render="#{assortiment.dirty}" message="#{msg.confirmunavailable}"/> </h:commandbutton> 

when remove ´an:confirm....´ bean isn't reloaded. nice know if facesbehavior can or cannot used in collaboration viewscoped bean.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -