Web Images Videos Maps News Groups Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
pattern for run a method on start of the page only 1 time
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
akhanof  
View profile  
 More options Jul 1, 9:58 pm
From: akhanof <amir.kha...@gmail.com>
Date: Wed, 1 Jul 2009 04:58:04 -0700 (PDT)
Local: Wed, Jul 1 2009 9:58 pm
Subject: pattern for run a method on start of the page only 1 time
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


    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.
Vik  
View profile  
 More options Jul 2, 7:48 am
From: Vik <vik....@gmail.com>
Date: Wed, 1 Jul 2009 14:48:50 -0700
Local: Thurs, Jul 2 2009 7:48 am
Subject: Re: [ADF Enterprise Methodology Group] pattern for run a method on start of the page only 1 time

hie
why dont you make ur method side effect free second time..

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.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.
Marcos Ortega  
View profile  
 More options Jul 2, 9:13 am
From: Marcos Ortega <mar...@santoandrea.com.br>
Date: Wed, 1 Jul 2009 19:13:44 -0400
Local: Thurs, Jul 2 2009 9:13 am
Subject: Re: [ADF Enterprise Methodology Group] pattern for run a method on start of the page only 1 time

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>


    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.
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

--
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.
Marcos Ortega  
View profile  
 More options Jul 2, 9:53 am
From: Marcos Ortega <mar...@santoandrea.com.br>
Date: Wed, 1 Jul 2009 19:53:20 -0400
Local: Thurs, Jul 2 2009 9:53 am
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

Some times,     we don't know  if the event was executed (user change some
UI component), for example , if the onChangeEvent Handler is at one backing
bean , and the onPageLoad is on another manage Bean;

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

2009/7/1 Vik <vik....@gmail.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.
Steve Muench  
View profile  
 More options Jul 2, 7:02 pm
From: Steve Muench <steve.mue...@gmail.com>
Date: Thu, 2 Jul 2009 11:02:23 +0200
Local: Thurs, Jul 2 2009 7:02 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

We strongly recommend using a methodCall activity in a task flow to perform
any kind of "at page startup" logic in JDev/ADF 11g. It works reliably for
page- as well as page-fragment-based use cases, including when "lazy"
content delivery is used (which causes an additional page lifecycle (i.e.
http roundtrip) to the server to lazily fetch data for the table/tree/graph.
We no longer recommend using the invokeAction executable for this purpose
due to their not existing any viable EL expression to use to detect the
"first time render" that works in all possible scenarios.

On Thu, Jul 2, 2009 at 1:53 AM, Marcos Ortega <mar...@santoandrea.com.br>wrote:


    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.
fnimphiu  
View profile  
 More options Jul 3, 4:35 am
From: fnimphiu <frank.nimph...@googlemail.com>
Date: Thu, 2 Jul 2009 11:35:37 -0700 (PDT)
Local: Fri, Jul 3 2009 4:35 am
Subject: Re: pattern for run a method on start of the page only 1 time
Folks,

this thread is missing some structure.

Amir, you don't mention a JDeveloper release, but from your
"condition="#{!adfFacesContext.postback}" mentioning I point it to
10.1.3, which makes Steve's effort in answering your question a waste
of time, which should not happen on this group. To address your
question, can you identify the phases in which the method is invoked ?
If for example the method is invoked twice in a single phase then a
flag helps to prevent double execution. If it is executed in two
different phases then you may look at the setting of the refresh
option. If you have this set to ifNeeded then execution happens twice.
Set it to prepareRender or prepareModel and this should help already.

Frank

On Jul 2, 11:02 am, Steve Muench <steve.mue...@gmail.com> wrote:


    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.
Marcos Ortega  
View profile  
 More options Jul 3, 3:45 am
From: Marcos Ortega <mar...@santoandrea.com.br>
Date: Thu, 2 Jul 2009 13:45:29 -0400
Local: Fri, Jul 3 2009 3:45 am
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

Hi , Steve;
    Lets supose a page invoked from a main menu , it would be point to a
"pre-configure-page" method, that prepare the model and than redirect to the
target page ?

   My application ( I think that is a good example ) has
*current_project*as global variable, and all the data rows must be
filtered by this
"current_project" ;  so, as we can have severals page-flows; is a good
aproche to have one manage bean in each page-flow where we have all
pre-calls methods ?

    I was doing this job using page life cycle beans ....

  Thanks !!

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

2009/7/2 Steve Muench <steve.mue...@gmail.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.
Steve Muench  
View profile  
 More options Jul 4, 6:18 pm
From: Steve Muench <steve.mue...@gmail.com>
Date: Sat, 4 Jul 2009 10:18:33 +0200
Local: Sat, Jul 4 2009 6:18 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

I generally avoid managed beans for anything except complex UI manipulation
or complex conditional navigation. I'd recommend putting any knid of
"initialize task flow" type of logic related to setting up the data as a
custom application module method that can be exposed on the client interface
of the AM and invoked declaratively by a methodCall activity on a task flow
in 11g.

In 10.1.3, the invokeAction executable was the preferred approach to trigger
the same method binding to invoke the "initialize" method, but in 11g we
have a more robust, self-documenting, and easier-to-understand approach with
the methodCall activity.

On Thu, Jul 2, 2009 at 7:45 PM, Marcos Ortega <mar...@santoandrea.com.br>wrote:


    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.
amir hosein khanof  
View profile  
 More options Jul 11, 10:37 pm
From: amir hosein khanof <amir.kha...@gmail.com>
Date: Sat, 11 Jul 2009 17:07:51 +0430
Local: Sat, Jul 11 2009 10:37 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

Hi,

Thanks for Steve MethodCall activity in the Task Flow is easy,
reusable,separate logics, fortunately I am working with 11g R1 and the thing
here is that when I drag and drop a method from datacontrol to the Task Flow
as the start point and default activity of the task flow when the task flow
is invoked (embed in a popup) I face the error
*oracle.jbo.InvalidOperException:
JBO-25221* regarding the mentioned pattern can anyone suggest me what is
wrong as I have noticed the mehod is not even invoked at all.

Thanks and regards,
Amir

On Sat, Jul 4, 2009 at 12:48 PM, Steve Muench <steve.mue...@gmail.com>wrote:


    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.
Steve Muench  
View profile  
 More options Jul 12, 6:44 pm
From: Steve Muench <steve.mue...@gmail.com>
Date: Sun, 12 Jul 2009 10:44:56 +0200
Local: Sun, Jul 12 2009 6:44 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: pattern for run a method on start of the page only 1 time

If a simple example of calling the same method in a default activity works
fine when used outside of the taskflow-in-a-*popup *scenario, then likely
the problem is that you have missed some step in correctly setting up your
region in a popup as documented in David Giammona's whitepaper on OTN here:

http://www.oracle.com/technology/products/adf/patterns/popupregionpat...

On Sat, Jul 11, 2009 at 2:37 PM, amir hosein khanof
<amir.kha...@gmail.com>wrote:


    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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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