seam2 - Seam - understanding PAGE scope and CONVERSATION scope -
i still confused page , conversation (temp) scope. maybe here. fas know, variables outjected page scope live long user postbacks same page. temporary conversation scope instead survives redirect next page. here little example 2 effects confusing me:
first, component , outjections in conversation scope , tempuser data displayed in jsf page. in save method called jsf-page, injected tempuser null. why?
second, if same change component , @in/@outs scopes page scope, tempuser gets correctly injected on postback - gets not saved, wathever reason, although super.update()-method on userhome gets called. or there problem in using homeentities ways (the idea iwa use them dao wrapper)?
@name("useraction") @scope(scopetype.conversation) public class useraction implements serializable { private static final long serialversionuid = -4852371546895918692l; @in(create = true) private userhome userhome; @out(scope = scopetype.conversation) @in(required = false,scope = scopetype.conversation) user tempuser; @requestparameter private long userid; @factory("tempuser") public user getuser() { if (tempuser == null) { userhome.setuserid(userid); tempuser = userhome.getinstance(); userhome.clearinstance(); } return tempuser; } public void save() { userhome.setinstance(tempuser); userhome.update(); } } the xhtml contains a:form with
<a:commandbutton id="update" styleclass="button admin" action="#{useraction.save}" value="#{messages['user.action.update']}"/> thanks replies. sorry, if 2 problems in one.
Comments
Post a Comment