From your explanation it sounds like this isn't working for you because you are completely misusing the WOLongResponsePage. You have your "Subcomponent" extending WOLongResponsePage. If of all is "Subcomponent" a partial page or a full page. If it's a full page then why is it named "Subcomponent." But, that's a bit beside the point.

It sounds like you also have a "WaitPage," That's the page that should be extending WOLongResponsePage, because it's the WOLongResponsePage that gives you your separate thread in which to process your long response.

A typical use case would be to have 2 or 3 pages. I'll call them A, B and C.

A -- The originating page
B -- The long response processing page
C -- The result page

An action in A would return B. B would process the response and when complete will instantiate C. It's entirely possible for A to equal C. In other words you originating page (A) can act as the result page (C) for the long response page (B).

In this use case the only page the extends WOLongResponsePage is B.

The Apple examples that you mentioned are actually really good at explaining how these pages work. If you use one of the several design patterns laid out in the examples you should be fine.

On May 2, 2007, at 6:08 AM, [EMAIL PROTECTED] wrote:

I want to use the WOLongResponsePage and have successfully worked through the examples from apple. Now I thought that I could do something slight different
from the examples, but there appear problems.

My minimum example contains the classes Application, Main, WaitPage and in
one case, Subcomponent.
My first problem occurs, when I try to use the class Subcomponent as WOLong- ResponsePage but return a different WOComponent as waiting page to display
during the long calculations:

class Subcomponent extends WOLongResponsePage
{
   ...
   public WOComponent refreshPageForStatus(Object o)
  {
        return pageWithName(WaitPage.class.getName());
  }
   ...
}

The problem is that the refresh of the WOLongResponsePage seems to be interrupted: refreshPageForStatus(..) gets only called once and pageForResult (..) is never called.

So question No1:
How is it possible to use another waiting page as the WOLongResponsePage-class?


Another problem occured when I tried to realize the WOLongResponsePage (LRP) as
a local, inner class. Something like that:

public class Main()
{
   public WOComponent startLongQuery()
   {
WOLongResponsePage query = new WOLongResponsePage (this.context())
                {

                        public Object performAction()
                        {
                                try
                                {
                                        System.out.println("pausing ..");
                                        Thread.sleep(5000);
                                }
                                catch(InterruptedException e)
                                {
                                        e.printStackTrace();
                                }
                                return new Integer(5);
                        }
                        
                        
                        public WOComponent refreshPageForStatus( Object status )
                        {
                                System.out.println("activating WaitPage 
"+status);
                                return pageWithName(WaitPage.class.getName());
                        }
                        
                        
                        public WOComponent pageForResult(Object v)
                        {
                                System.out.println("activating result page "+v);
                                return pageWithName(NextPage.class.getName());
                        }
                };
                query.setRefreshInterval(1);
                
                return query;
   }
}


There I get the error, that the backtrack-cache exceeded, no matter how big its size was chosen. I know that every refresh fills the cache with a whole site (plus every internal frame) but in my example this would be only one cache slot per
refresh.
The only thing I could image to cause problems is that the inner class is not a full component because it lacks a html and wod-file. My thought is that the displayed
pages are WaitPage or as result NextPage.

I'm looking forward for some explanations!
Thx in advance
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/robertwalker1% 40mac.com

This email sent to [EMAIL PROTECTED]

--
Robert Walker
[EMAIL PROTECTED]



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to