You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by david joffrin <da...@hotmail.com> on 2005/03/31 00:01:03 UTC

IExternalPage

Hi,

All my pages are implementing the IExternalPage interface as I decided that 
all my pages will be accessed via the ExternalLink component, but, how do I 
implement the activation of a page inside my application code:
    public void onCancel(IRequestCycle cycle) {
        ViewProfile page = (ViewProfile) cycle.getPage("ViewProfile");
        cycle.activate(page);
    }
The ViewProfile needs date loaded in the activateExternalPage method. Shall 
I move the code to a common method? Or is there a way to activate the 
external link?

Thanks.
David



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: IExternalPage

Posted by Steven Porter <sp...@yahoo.co.uk>.
Alternatively, if you would prefer to "tell your pages" what their
properties are, rather than have them "discover" there properties in
pageRenderListener, then it's as simple as:

public void onCancel(IRequestCycle cycle) {
   ViewProfile page = (ViewProfile) cycle.getPage("ViewProfile");
   page.setMyProperty(...);
   page.setMyProperty2(...);
   cycle.activate(page);
}

The two different approaches are thought of as "push" versus "pull".

If you have property setters such as above, then the implementation of
activateExternalPage should use them as well, extracting the values from the
parameters.

sp

> -----Original Message-----
> From: Jamie Orchard-Hays [mailto:jamie@dang.com]
> Sent: 30 March 2005 23:26
> To: Tapestry users
> Subject: Re: IExternalPage
>
>
> You can implement pageBeginRener() of PageRenderListener interface and
> put all the work in there. Just set the parameters you need in
> activateExternalPage() and let pageBeginRender() handle the rest.
>
> david joffrin wrote:
>
> > Hi,
> >
> > All my pages are implementing the IExternalPage interface as I decided
> > that all my pages will be accessed via the ExternalLink component,
> > but, how do I implement the activation of a page inside my application
> > code:
> >    public void onCancel(IRequestCycle cycle) {
> >        ViewProfile page = (ViewProfile) cycle.getPage("ViewProfile");
> >        cycle.activate(page);
> >    }
> > The ViewProfile needs date loaded in the activateExternalPage method.
> > Shall I move the code to a common method? Or is there a way to
> > activate the external link?
> >
> > Thanks.
> > David
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: IExternalPage

Posted by Jamie Orchard-Hays <ja...@dang.com>.
You can implement pageBeginRener() of PageRenderListener interface and 
put all the work in there. Just set the parameters you need in 
activateExternalPage() and let pageBeginRender() handle the rest.

david joffrin wrote:

> Hi,
>
> All my pages are implementing the IExternalPage interface as I decided 
> that all my pages will be accessed via the ExternalLink component, 
> but, how do I implement the activation of a page inside my application 
> code:
>    public void onCancel(IRequestCycle cycle) {
>        ViewProfile page = (ViewProfile) cycle.getPage("ViewProfile");
>        cycle.activate(page);
>    }
> The ViewProfile needs date loaded in the activateExternalPage method. 
> Shall I move the code to a common method? Or is there a way to 
> activate the external link?
>
> Thanks.
> David
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org