-
1. Re: Implementing an @OnViewLoad
israel.bgf Aug 26, 2009 3:58 PM (in response to israel.bgf)The final thing should be something like this:
@Scope(ScopeType.SESSION)
public class Bean{@OnViewLoad
public void onLoad(){
System.out.println(this is only executed once per view acess
);
System.out.println(Postbabacks do not trigger this method
);
}}
The problem is: i dont know how to say to seam:
Hey framework, always that something is executed in a class check for an @OnViewLoad, if you find it try this method:
if(/blabla.isPostback?/){
//execute the method
} else {
//ignore it and keep going
}Got it?
Thanks in advance,
-
2. Re: Implementing an @OnViewLoad
cash1981 Aug 26, 2009 9:53 PM (in response to israel.bgf)Why cant you just create a normal conversation scoped component with a @Create method, and then you can execute that on pages.xml with execute action. The difference between a page scoped component and an conversation (not long running conversation) is a conversation also lives through a redirect.
This should solve your problem. Yes its a workaround, but it should work.
-
3. Re: Implementing an @OnViewLoad
swd847 Aug 27, 2009 1:28 PM (in response to israel.bgf)You want to add a default interceptor that does this check. This is a pain at the moment as you have to list all the default interceptors plus your new one in the
<core:init>
tag.
-
4. Re: Implementing an @OnViewLoad
israel.bgf Aug 27, 2009 1:38 PM (in response to israel.bgf)How exactly is the syntax to achieve this Stuart? And Shervin, you are right there are some other ways to achieve that, but at the moment i'm trying to see
custom annotations in action
, :)