cycle.activate will make the "activated" page be the page that renders.
However... the xtile service doesn't result in a page render. It results in an "ajax" response; hence, cycle.activate won't work. What you might consider doing is putting the url of the page you want to activate into the service parameters. Then you could just replace the document location with the new url. Something along the lines of:

else {
  IEngineSerivce svc = cycle.getEngine().getService(Tapestry.PAGE_SERVICE);
  Object[] params = new Object[] { "NoviaMail_ReadMail" };
  ILink link = svc.getLink(false,params);
cycle.setServiceParameters(new Object[] {"redirect",link.getAbsoluteURL()});
}

and in javascript, something like:

my_function(params) {
  if (params[0] == "redirect") {
    document.location.href=params[1];
    return;
  }
  ...
}

Something along those lines.

Robert

MattHouston wrote:
Hi !

I have a probleme using the XTile component and cycle.activate.
I do sth in AJAX with XTile and in my Java function who handle requests,
sometimes i only receive and send requests to the client, that works good.
But i would like to sometimes not send a request but activate another page,
I thought I can do that with cycle.activate, but it doesn't works...

The code of my function :
        public void handleListOfMailsRequest(IRequestCycle cycle) {
                Object[] params = ((RequestCycle) cycle).getServiceParameters();
                System.out.println("length parmas : "+params.length);
                if (params.length == 0) return;
                
                if (params[0].equals("isNews")) { // works good
                        [...]
                        
                        String[] ret = {mm.getDate(), mm.getFrom(), 
mm.getSubject(),
mm.getSize(), "false", mm.getId()};
                        ((RequestCycle) cycle).setServiceParameters(ret);
                }
                else { //dont work
                        cycle.activate(NoviaMail_ReadMail);
                }
        }

Any help will be apprecated.
Thanks

MattHouston



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to