Hi Thiago,

Thanks for you assistance and reply.  Can I understand correctly what is
going on here and do the following:

The object 'SomeOtherPage' I need to be my Page 2 so:

public class Page1{
@Inject Page2 page2;

       Object onActionFromStart() {
               ...
               page2.setNextPage(Page2.class); ---- (This is what I need,
but is this the correct thing to do here?)
        }
}

public class Page2{
           @Persist(PersistenceConstants.FLASH)
           private Page2 page2;  --- (You used Class nextPage in your
example, but is my understanding correct in what I've written, we are
referring to the page we are on (Page2 in this instance))

          @Inject
          private PageRenderLinkSource prls;

         public void setNextPage(Class page2){

         }



}


On Fri, Mar 9, 2012 at 1:12 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 09 Mar 2012 09:34:25 -0300, Az Madu <azm...@gmail.com> wrote:
>
>  Hi guys,
>>
>
> Hi!
>
>
>  So my questions are:
>>
>> 1 -  can we know what the url is of any page in our application
>> programmatically?
>>
>
> @Inject
> private PageRenderLinkSource pageRenderLinkSource
> ...
> then use one of its methods.
>
>
>  2 -  can we use this information and pass it as a parameter into another
>> page even if it is the other page?
>>
>
> Yes, but you can pass the page itself instead of its URL if you prefer (I
> would):
>
> public class Page1 {
>
>        @InjectPage
>        private Page2 page2;
>
>        Object onActionFromStart() {
>                ...
>                page2.setNextPage(**SomeOtherPage.class);
>        }
>
> }
>
> public class Page2 {
>
>        @Persist(PersistenceConstants.**FLASH)
>        private Class nextPage;
>
>        @Inject
>        private PageRenderLinkSource pageRenderLinkSource;
>
>        public void setNextPage(Class page) {
>                this.page = page;
>        }
>        public String getNextPageUrl() {
>                return pageRenderLinkSource.**
> createPageRenderLink(nextPage)**.toAbsoluteURI();
>        }
> }
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>

Reply via email to