You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Benny Weingarten <be...@myworklight.com> on 2008/07/01 08:33:30 UTC

Re: onBeginRequest()

Hello,
perhaps my question doesn't belong in this thread, but here it is.

I'm developing a facebook app with wicket, and each page needs to have
access to the FacebookClient for its rendering. I have done so by overriding
beforeCallComponent in each XXXPage classes, and set the facebookClient
there.

However, when I try to link to the page by using bookmarkablePageLink, I
have noticed that the method beforeCallComponent doesn't get called, and my
page throws an exception because the FacebookClient isn't set.

1) Is this expected behavior? (for the beforeCallComponent not to be called
if the page is linked to by a bookmarkablePageLink)
2) If so, what would be a good place to put the FacebookClient
initialization code?

thanks,
Benny




Juergen Donnerstag wrote:
> 
> Not sure I want the additional methods. Jon opened an RFE on
> rethinking the current lifecycle management. May be we should have
> that discussion first.
> 
> Juergen
> 
> On 3/9/06, Johan Compagner <jc...@gmail.com> wrote:
>> that would be a better name yes.
>> Don't know if we can break that in 1.2..
>>
>> We could depricate it and point to onBeginRender()
>>
>> Do we also need to have a onBeginRequest (or onBeginEventDispatch())?
>>
>> johan
>>
>>
>>
>> On 3/9/06, sven@meiers.net <sv...@meiers.net> wrote:
>> > I once again stumbled over the misnaming of Component#onBeginRequest().
>> >
>> > As already discussed it would better be named onBeginRender():
>> >
>> > >
>> http://sourceforge.net/mailarchive/message.php?msg_id=13357646
>> >
>> > Was the decision to rename these methods voted down or just forgotten?
>> >
>> > Sven
>> >
>> >
>> > -------------------------------------------------------
>> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> > that extends applications into web and mobile media. Attend the live
>> webcast
>> > and join the prime developer group breaking into this new coding
>> territory!
>> >
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>> > _______________________________________________
>> > Wicket-develop mailing list
>> > Wicket-develop@lists.sourceforge.net
>> >
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>> >
>>
>>
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Wicket-develop mailing list
> Wicket-develop@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> 
> 

-- 
View this message in context: http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210121.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: [Wicket-develop] onBeginRequest()

Posted by Johan Compagner <jc...@gmail.com>.
IComponentInstantiationListener


On Tue, Jul 1, 2008 at 9:20 AM, Benny Weingarten <be...@myworklight.com>
wrote:

>
> This could work. I am not very proficient with Spring. I have googled
> initializelistener, but came up empty handed. Could you point me to an
> article explaining the term? I could pick it up form there.
>
> I"ll also investigate options using the constructor.
>
> thanks,
> Benny.
>
>
>
> Johan Compagner wrote:
> >
> > If you use a bookmarkable page then noi component is called. Just the
> > constructor of the page. Cant you inject it the same way we inject
> > spring? With an initializelistener?
> >
> > On 7/1/08, Benny Weingarten <be...@myworklight.com> wrote:
> >>
> >> Hello,
> >> perhaps my question doesn't belong in this thread, but here it is.
> >>
> >> I'm developing a facebook app with wicket, and each page needs to have
> >> access to the FacebookClient for its rendering. I have done so by
> >> overriding
> >> beforeCallComponent in each XXXPage classes, and set the facebookClient
> >> there.
> >>
> >> However, when I try to link to the page by using bookmarkablePageLink, I
> >> have noticed that the method beforeCallComponent doesn't get called, and
> >> my
> >> page throws an exception because the FacebookClient isn't set.
> >>
> >> 1) Is this expected behavior? (for the beforeCallComponent not to be
> >> called
> >> if the page is linked to by a bookmarkablePageLink)
> >> 2) If so, what would be a good place to put the FacebookClient
> >> initialization code?
> >>
> >> thanks,
> >> Benny
> >>
> >>
> >>
> >>
> >> Juergen Donnerstag wrote:
> >>>
> >>> Not sure I want the additional methods. Jon opened an RFE on
> >>> rethinking the current lifecycle management. May be we should have
> >>> that discussion first.
> >>>
> >>> Juergen
> >>>
> >>> On 3/9/06, Johan Compagner <jc...@gmail.com> wrote:
> >>>> that would be a better name yes.
> >>>> Don't know if we can break that in 1.2..
> >>>>
> >>>> We could depricate it and point to onBeginRender()
> >>>>
> >>>> Do we also need to have a onBeginRequest (or onBeginEventDispatch())?
> >>>>
> >>>> johan
> >>>>
> >>>>
> >>>>
> >>>> On 3/9/06, sven@meiers.net <sv...@meiers.net> wrote:
> >>>> > I once again stumbled over the misnaming of
> >>>> Component#onBeginRequest().
> >>>> >
> >>>> > As already discussed it would better be named onBeginRender():
> >>>> >
> >>>> > >
> >>>> http://sourceforge.net/mailarchive/message.php?msg_id=13357646
> >>>> >
> >>>> > Was the decision to rename these methods voted down or just
> >>>> forgotten?
> >>>> >
> >>>> > Sven
> >>>> >
> >>>> >
> >>>> > -------------------------------------------------------
> >>>> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> >>>> language
> >>>> > that extends applications into web and mobile media. Attend the live
> >>>> webcast
> >>>> > and join the prime developer group breaking into this new coding
> >>>> territory!
> >>>> >
> >>>>
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> >>>> > _______________________________________________
> >>>> > Wicket-develop mailing list
> >>>> > Wicket-develop@lists.sourceforge.net
> >>>> >
> >>>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >>>> >
> >>>>
> >>>>
> >>>
> >>>
> >>> -------------------------------------------------------
> >>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> >>> language
> >>> that extends applications into web and mobile media. Attend the live
> >>> webcast
> >>> and join the prime developer group breaking into this new coding
> >>> territory!
> >>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid 0944&bid$1720&dat 1642
> >>> _______________________________________________
> >>> Wicket-develop mailing list
> >>> Wicket-develop@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210121.html
> >> Sent from the Wicket - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210680.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: [Wicket-develop] onBeginRequest()

Posted by Benny Weingarten <be...@myworklight.com>.
This could work. I am not very proficient with Spring. I have googled
initializelistener, but came up empty handed. Could you point me to an
article explaining the term? I could pick it up form there.

I"ll also investigate options using the constructor.

thanks,
Benny.



Johan Compagner wrote:
> 
> If you use a bookmarkable page then noi component is called. Just the
> constructor of the page. Cant you inject it the same way we inject
> spring? With an initializelistener?
> 
> On 7/1/08, Benny Weingarten <be...@myworklight.com> wrote:
>>
>> Hello,
>> perhaps my question doesn't belong in this thread, but here it is.
>>
>> I'm developing a facebook app with wicket, and each page needs to have
>> access to the FacebookClient for its rendering. I have done so by
>> overriding
>> beforeCallComponent in each XXXPage classes, and set the facebookClient
>> there.
>>
>> However, when I try to link to the page by using bookmarkablePageLink, I
>> have noticed that the method beforeCallComponent doesn't get called, and
>> my
>> page throws an exception because the FacebookClient isn't set.
>>
>> 1) Is this expected behavior? (for the beforeCallComponent not to be
>> called
>> if the page is linked to by a bookmarkablePageLink)
>> 2) If so, what would be a good place to put the FacebookClient
>> initialization code?
>>
>> thanks,
>> Benny
>>
>>
>>
>>
>> Juergen Donnerstag wrote:
>>>
>>> Not sure I want the additional methods. Jon opened an RFE on
>>> rethinking the current lifecycle management. May be we should have
>>> that discussion first.
>>>
>>> Juergen
>>>
>>> On 3/9/06, Johan Compagner <jc...@gmail.com> wrote:
>>>> that would be a better name yes.
>>>> Don't know if we can break that in 1.2..
>>>>
>>>> We could depricate it and point to onBeginRender()
>>>>
>>>> Do we also need to have a onBeginRequest (or onBeginEventDispatch())?
>>>>
>>>> johan
>>>>
>>>>
>>>>
>>>> On 3/9/06, sven@meiers.net <sv...@meiers.net> wrote:
>>>> > I once again stumbled over the misnaming of
>>>> Component#onBeginRequest().
>>>> >
>>>> > As already discussed it would better be named onBeginRender():
>>>> >
>>>> > >
>>>> http://sourceforge.net/mailarchive/message.php?msg_id=13357646
>>>> >
>>>> > Was the decision to rename these methods voted down or just
>>>> forgotten?
>>>> >
>>>> > Sven
>>>> >
>>>> >
>>>> > -------------------------------------------------------
>>>> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
>>>> language
>>>> > that extends applications into web and mobile media. Attend the live
>>>> webcast
>>>> > and join the prime developer group breaking into this new coding
>>>> territory!
>>>> >
>>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>>>> > _______________________________________________
>>>> > Wicket-develop mailing list
>>>> > Wicket-develop@lists.sourceforge.net
>>>> >
>>>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>>> >
>>>>
>>>>
>>>
>>>
>>> -------------------------------------------------------
>>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>>> language
>>> that extends applications into web and mobile media. Attend the live
>>> webcast
>>> and join the prime developer group breaking into this new coding
>>> territory!
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid 0944&bid$1720&dat 1642
>>> _______________________________________________
>>> Wicket-develop mailing list
>>> Wicket-develop@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210121.html
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210680.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: [Wicket-develop] onBeginRequest()

Posted by Johan Compagner <jc...@gmail.com>.
If you use a bookmarkable page then noi component is called. Just the
constructor of the page. Cant you inject it the same way we inject
spring? With an initializelistener?

On 7/1/08, Benny Weingarten <be...@myworklight.com> wrote:
>
> Hello,
> perhaps my question doesn't belong in this thread, but here it is.
>
> I'm developing a facebook app with wicket, and each page needs to have
> access to the FacebookClient for its rendering. I have done so by overriding
> beforeCallComponent in each XXXPage classes, and set the facebookClient
> there.
>
> However, when I try to link to the page by using bookmarkablePageLink, I
> have noticed that the method beforeCallComponent doesn't get called, and my
> page throws an exception because the FacebookClient isn't set.
>
> 1) Is this expected behavior? (for the beforeCallComponent not to be called
> if the page is linked to by a bookmarkablePageLink)
> 2) If so, what would be a good place to put the FacebookClient
> initialization code?
>
> thanks,
> Benny
>
>
>
>
> Juergen Donnerstag wrote:
>>
>> Not sure I want the additional methods. Jon opened an RFE on
>> rethinking the current lifecycle management. May be we should have
>> that discussion first.
>>
>> Juergen
>>
>> On 3/9/06, Johan Compagner <jc...@gmail.com> wrote:
>>> that would be a better name yes.
>>> Don't know if we can break that in 1.2..
>>>
>>> We could depricate it and point to onBeginRender()
>>>
>>> Do we also need to have a onBeginRequest (or onBeginEventDispatch())?
>>>
>>> johan
>>>
>>>
>>>
>>> On 3/9/06, sven@meiers.net <sv...@meiers.net> wrote:
>>> > I once again stumbled over the misnaming of Component#onBeginRequest().
>>> >
>>> > As already discussed it would better be named onBeginRender():
>>> >
>>> > >
>>> http://sourceforge.net/mailarchive/message.php?msg_id=13357646
>>> >
>>> > Was the decision to rename these methods voted down or just forgotten?
>>> >
>>> > Sven
>>> >
>>> >
>>> > -------------------------------------------------------
>>> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
>>> language
>>> > that extends applications into web and mobile media. Attend the live
>>> webcast
>>> > and join the prime developer group breaking into this new coding
>>> territory!
>>> >
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>>> > _______________________________________________
>>> > Wicket-develop mailing list
>>> > Wicket-develop@lists.sourceforge.net
>>> >
>>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>> >
>>>
>>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid 0944&bid$1720&dat 1642
>> _______________________________________________
>> Wicket-develop mailing list
>> Wicket-develop@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210121.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: onBeginRequest()

Posted by Igor Vaynberg <ig...@gmail.com>.
easiest way is to retrieve it lazily

class yourrequestcycle extends webrequestcycle {

   private client c;

   public getclient() {
       if (c==null) {
          c=new client();
       }
       return c;
   }

}

then anywhere you need it: requestcycle.get().getclient();

-igor

On Mon, Jun 30, 2008 at 11:33 PM, Benny Weingarten
<be...@myworklight.com> wrote:
>
> Hello,
> perhaps my question doesn't belong in this thread, but here it is.
>
> I'm developing a facebook app with wicket, and each page needs to have
> access to the FacebookClient for its rendering. I have done so by overriding
> beforeCallComponent in each XXXPage classes, and set the facebookClient
> there.
>
> However, when I try to link to the page by using bookmarkablePageLink, I
> have noticed that the method beforeCallComponent doesn't get called, and my
> page throws an exception because the FacebookClient isn't set.
>
> 1) Is this expected behavior? (for the beforeCallComponent not to be called
> if the page is linked to by a bookmarkablePageLink)
> 2) If so, what would be a good place to put the FacebookClient
> initialization code?
>
> thanks,
> Benny
>
>
>
>
> Juergen Donnerstag wrote:
>>
>> Not sure I want the additional methods. Jon opened an RFE on
>> rethinking the current lifecycle management. May be we should have
>> that discussion first.
>>
>> Juergen
>>
>> On 3/9/06, Johan Compagner <jc...@gmail.com> wrote:
>>> that would be a better name yes.
>>> Don't know if we can break that in 1.2..
>>>
>>> We could depricate it and point to onBeginRender()
>>>
>>> Do we also need to have a onBeginRequest (or onBeginEventDispatch())?
>>>
>>> johan
>>>
>>>
>>>
>>> On 3/9/06, sven@meiers.net <sv...@meiers.net> wrote:
>>> > I once again stumbled over the misnaming of Component#onBeginRequest().
>>> >
>>> > As already discussed it would better be named onBeginRender():
>>> >
>>> > >
>>> http://sourceforge.net/mailarchive/message.php?msg_id=13357646
>>> >
>>> > Was the decision to rename these methods voted down or just forgotten?
>>> >
>>> > Sven
>>> >
>>> >
>>> > -------------------------------------------------------
>>> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
>>> language
>>> > that extends applications into web and mobile media. Attend the live
>>> webcast
>>> > and join the prime developer group breaking into this new coding
>>> territory!
>>> >
>>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
>>> > _______________________________________________
>>> > Wicket-develop mailing list
>>> > Wicket-develop@lists.sourceforge.net
>>> >
>>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>> >
>>>
>>>
>>
>>
>> -------------------------------------------------------
>> This SF.Net email is sponsored by xPML, a groundbreaking scripting
>> language
>> that extends applications into web and mobile media. Attend the live
>> webcast
>> and join the prime developer group breaking into this new coding
>> territory!
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid 0944&bid$1720&dat 1642
>> _______________________________________________
>> Wicket-develop mailing list
>> Wicket-develop@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wicket-develop
>>
>>
>
> --
> View this message in context: http://www.nabble.com/onBeginRequest%28%29-tp3316636p18210121.html
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>