Re: [Bulk] Re: add target to Link
On Mon, Dec 20, 2010 at 5:45 PM, Chuck Kring wrote: > The issue is that I'm returning a PageLink from an event handler. There > is no template involved. > Wouldn't it be impossible to retroactively determine where to open the next page? The browser is responsible for opening the link in a new window, etc. It looks at the target attribute to decide where to open it. If you want to return the information from an event handler, then it would have to be something that could be determined at run time AFTER the user has done the action. This means the browser would need to submit or follow a link and then receive information back that tells it to open a new window--at which point it would be too late. Mark
Re: [Bulk] Re: add target to Link
My mistake. I am only returning a link. I ended up using Javascript and it would have been nice to be able to set the target attribute in Java. My question was based upon the fact that you could do that in Tapestry 4 so I figured there was some other way to do this in T5. On 12/20/2010 4:17 PM, Thiago H. de Paula Figueiredo wrote: Link != PageLink. Link is not a component and it only represents an URL. There's no way of returning one and getting it to open in another tab without using JavaScript. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [Bulk] Re: add target to Link
On Mon, 20 Dec 2010 21:45:21 -0200, Chuck Kring wrote: The issue is that I'm returning a PageLink from an event handler. There is no template involved. Returning a component instance in an event handler isn't supported for any native Tapestry event except render lifecycle ones. Having said that, I've come up with a workable solution for now. The event handler returns null and rather I use the onClick() event handler on the button with a URL constructed from the PageLink. It's messy but not too bad. I would have preferred a setTarget() method on the Link. Link != PageLink. Link is not a component and it only represents an URL. There's no way of returning one and getting it to open in another tab without using JavaScript. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [Bulk] Re: add target to Link
Hi Howard, thanks for the response. The issue is that I'm returning a PageLink from an event handler. There is no template involved. This is called from a form in page embedded in a frame (I know...). In general the form does things like go back, etc, but in one case I want the form to return a page not in the frame - either as a tab or new window. Having said that, I've come up with a workable solution for now. The event handler returns null and rather I use the onClick() event handler on the button with a URL constructed from the PageLink. It's messy but not too bad. I would have preferred a setTarget() method on the Link. Regards, Chuck On 12/20/2010 2:21 PM, Howard Lewis Ship wrote: Have you tried this? Just adding a target="foo" attribute to the template will get the job done ... that's what informal parameters are for. On Sat, Dec 18, 2010 at 8:34 PM, Chuck Kring wrote: Hello, I have a submit button that returns a link that I'd like to have open in a new window. I noticed that the Tapestry 4 link API supported specification of that target, but I can figure out how to do it in Tapestry 5.1.0.5. How do I specify the target for a Link in Tapestry 5? Thanks in advance. Chuck - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: add target to Link
Have you tried this? Just adding a target="foo" attribute to the template will get the job done ... that's what informal parameters are for. On Sat, Dec 18, 2010 at 8:34 PM, Chuck Kring wrote: > Hello, > > I have a submit button that returns a link that I'd like to have open in a > new window. I noticed that the Tapestry 4 link API supported specification > of that target, but I can figure out how to do it in Tapestry 5.1.0.5. > > How do I specify the target for a Link in Tapestry 5? > > Thanks in advance. > > Chuck > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com
add target to Link
Hello, I have a submit button that returns a link that I'd like to have open in a new window. I noticed that the Tapestry 4 link API supported specification of that target, but I can figure out how to do it in Tapestry 5.1.0.5. How do I specify the target for a Link in Tapestry 5? Thanks in advance. Chuck - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org