<lars.borup <at> email.dk> writes:
> I was wondering if it is somehow possible to add request parameters to a
> PageLink? I've written a PopupLinkRenderer to be used with a PageLink but
> since the PageLink component cannot take any parameters
Tapestry is all about *not* figuring out URL's. You write your pages using
object properties, and tapestry will assemble the correct URL's to reference
them. The moment you start to think how to add a request parameter to a tapestry
URL, you've just found out that something is wrong.
Are you really calling WebRequest.getParameter() on your page? If yes, think
about it again. Try to code it as an external page (implement IExternalPage),
and read the necessary parameters on activateExternalPage(). Then you can just
use an ExternalLink to reference your page.
Something like this:
public abstract class UserPage extends BasePage implements IExternalPage
{
public abstract String getUserName();
public abstract void setUserName(String name);
/**
* Activates the user details page. The user name should be the first
* external parameter.
*/
public void activateExternalPage(Object[] params, IRequestCycle cycle)
{
setUserName((String) params[0]);
}
}
And to link to the above page, you can use something like:
<a jwcid="@ExternalLink" page="UserPage" parameters="ognl:currentUser">Edit
Profile</a>
The generated link will look somewhat like
"http://myhost/app?service=external&page=UserPage&sp=Sjoe", but you shouldn't
care about it. All you care is that your external page needs one parameter, and
that it's provided in the link.
I hope that helped,
-- Marcus Brito
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]