Hi,
how can I do a redirect from a XHR-request? Here an example to make clear
what I want to do:

I've got a couter-component which shows a count and 2 links (up and down).
If a link is clicked, the count is changed inPlace. A "ValueChanged"-Event
is triggered on every change.

[Pseudo-Code. won't compile, just to show the intention]
class Counter{
    @Property private int count;

    EventCallback callback = new EventCallback(){
        boolean handleEvent(...){
            ...
        }
    };

    onUp(){
        count++;
        resources.triggerEvent("valueChanged", new Object[]{count},
callback);
    }
    onDown(){
        count--;
        resources.triggerEvent("valueChanged", new Object[]{count},
callback);
    }
}


That counter can be used on pages and the page can do something if user
changes value.

class CounterPage{

     Object onValueChangeFromMyCounter(int count){
          if(count > Oracle.MYSTICAL_VALUE){
                System.secretOperation();
          }
     }

}

Now my question is how to do a page-redirect in the EventListener on the
page? I can return an URL from it but to do with it in the callback? Which
service is responsible? And does tapestry.js handle redirects in
XHR-requests as W3C-XHR doesn't?

Greetings

Mario

Reply via email to