Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion pattern for run a method on start of the page only 1 time
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Avrom Roy-Faderman  
View profile  
 More options Jul 2, 12:38 pm
From: "Avrom Roy-Faderman" <av...@avromroyfaderman.com>
Date: Wed, 1 Jul 2009 19:38:27 -0700
Local: Thurs, Jul 2 2009 12:38 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time
For a VO method, I think a bind variable (to hold a "this method's already
been executed" flag) is probably the best way to do this. For a view row
method, use a transient attribute (make sure it's marked for
passivation--see below). For an application module method, you could try
setting a value on the Map returned by
ApplicationModuleImpl.getSession().getUserData().

One thing you *don't* want to do is just make a field and store your flag
in that, unless you're willing to override methods like
prepareForPassivation() and activateState(). If you just use an ordinary
Java field, the value could disappear if the application module gets
recycled.

Best,
Avrom

> That's a great question ; Frank;

>      Earlier this week ,

>        I posted this
> thread<http://forums.oracle.com/forums/message.jspa?messageID=3586332#3586332>at
> otn jDev's forum too; but no cookies for me !

>        As i describe there, to work around this "so many call's" I; early
> check if my viewObjects parameter are set  and if the value is equal my
> current params;

>        So depending on the target viewObject's parameters; I set or not
> and
>  re-execute the viewObject;

>      Other behavior that I would like to insert here, is how we can
> coordnate the execution of onChangeEvent (from any faces component) and
> onLoadPage ( or prepareModel ) phase;

>      if we log this two methods we will have;

>         on Log window;

>               Hi there ... from prepareModel (loadPage)
>               Hi there ... from onChangeEvent
>               Hi there ... from prepareModel (loadPage)

>     Do we have some "best pratices" for this ??

>     Or perhaps i'm missunderestanding something ....

> Thanks too;

>       Marcos Ortega
>  Analista de Sistemas
>   Campo Grande - MS
> http://www.santoandrea.com.br

> 2009/7/1 akhanof <amir.kha...@gmail.com>

>> Hi,

>> Regarding to invoke a method in the page start up and only one time I
>> am looking for the best pattern to use;
>> because using the (refresh condition= not post back) is some times
>> invoked more than one time making it inappropriate when we absolutely
>> need to run the method only 1 time .
>> is there any other option or pattern except setting the refresh
>> condition="#{!adfFacesContext.postback}" for execution of the method
>> on the invokeaction for method on the page bindings.

>> Thanks and regards,
>> Amir

--
Avrom’s Java EE and Oracle ADF Blog
http://www.avromroyfaderman.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google