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.
On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
> 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.
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)
> 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.
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.
> 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 ....
>> 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.
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;
> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
>> 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.
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:
> 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;
>> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
>>> 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.
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:
> 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:
> > 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;
> >> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
> >>> 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.
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 ....
> 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:
>> 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;
>>> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
>>>> 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.
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:
> 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 ....
> 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:
>>> 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;
>>>> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
>>>>> 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 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:
> 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:
>> 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 ....
>> 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:
>>>> 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;
>>>>> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com> wrote:
>>>>>> 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.
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:
> 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:
>> 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:
>>> 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 ....
>>> 2009/7/2 Steve Muench <steve.mue...@gmail.com>
>>> 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:
>>>>> 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;
>>>>>> On Wed, Jul 1, 2009 at 4:58 AM, akhanof <amir.kha...@gmail.com>wrote:
>>>>>>> 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.