How to get the name of last visited page?

View: New views
2 Messages — Rating Filter:   Alert me  

How to get the name of last visited page?

by Serethos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Imagine I have written two pages and linked them to two Java-classes, both WOComponents. The first page has a dynamically created link to the second page and calls it via pageWithName(..). How can I find out the name of the calling page within the second (target) page?

Re: How to get the name of last visited page?

by Fabian Peters-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Serethos,

> Imagine I have written two pages and linked them to two Java-
> classes, both
> WOComponents. The first page has a dynamically created link to the  
> second
> page and calls it via pageWithName(..). How can I find out the name  
> of the
> calling page within the second (target) page?

Let your components inherit from a custom parent that implements sth.  
like:

     public WOComponent lastPage;

     public WOComponent pageWithName(String name) {
         WOComponent page = super.pageWithName(name);
         if (name.equals(this.name()))
             page.takeValueForKey(this.lastPage, "lastPage");
         else
             page.takeValueForKey(this, "lastPage");
         return page;
     }

     public WOComponent lastPage() {
         return lastPage;
     }

     public boolean hasLastPage() {
         return (lastPage == null ? false : true);
     }

HTH

Fabian



_______________________________________________
WebObjects-dev mailing list
WebObjects-dev@...
http://www.omnigroup.com/mailman/listinfo/webobjects-dev