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

Fabian Peters <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.