On Fri, 14 Nov 2014 12:26:30 -0200, Robson Pires <[email protected]> wrote:

Hi guys,

Hi! (Bão? :))


I am handling an event in a page A which was bubbling from a component B:

ComponentB.java

componentResources.triggerEvent(BULK_ACTION_SELECTED, new Object[] {
selectedAction, keys}, null);

PageA.java

 void onBulkActionSelectedFromresourceSearchResults(String context,
      long[] keys) throws IOException {

response.sendRedirect(getPageURL(linkSource, "resource/group", keys));

  }

You have absolutely no reason to redirect using Response.sendRedirect(). Just return the Link directly and Tapestry will take care of the redirect for you:

  Object onBulkActionSelectedFromresourceSearchResults(String context,
       long[] keys) throws IOException {

     return getPageURL(linkSource, "resource/group", keys));

  }

More details here: http://tapestry.apache.org/page-navigation.html. It's more common, but equally correct, to @InjectPage the target page, set the values you want on it, then return it, supposing the target page class has an onPassivate() method.

As you can see I am trying to redirect to another page, is there any
problem in using redirect inside of an event bubbled up for a component ,

Absolutely not. This is 100% valid.

because in my case the page is not submitting.

What do you mean by "submitting"? Redirecting?

Have you checked whether your event handler method has actually been invoked?

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to