You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel Leffel <da...@gmail.com> on 2007/03/19 05:38:22 UTC

Throwing a RedirectException to an ExternalLink inside a component

Hi all,
I'm sorry for the dumb question. I've just started trying to kick my
component development into high gear.

I have a search box component in the header component of my project. I
am using ExternalLink for SEO purposes and I can't figure out how to
render the ExternalLink. I've resorted to the below (which does work,
but ideally I'd like to let Tapestry render the link). Can someone
quickly tell me how to fix this?

-------
public abstract class Header extends AbstractComponent implements
PageBeginRenderListener {
	public void pageBeginRender(final PageEvent event)  {
		if (event.getRequestCycle().getParameter("search_query")!=null){
			Search search = (Search) event.getRequestCycle().getPage("search");
			
    		throw new
RedirectException("/search/S"+event.getRequestCycle().getParameter("search_query")
);
		}
    }
	
	
	
	protected void renderComponent(IMarkupWriter writer, IRequestCycle
cycle){
              ... (Rendering the form stuff here)
	}

}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org