I am using @ActivationRequestParameter and perhaps this is feature under
some circumstances but currently it seems like a bug to me.

In this case I have a menu item called 'All Prints' that goes to a page
that might set ARP fields from a search. I'd like the menu link to always
go to the page without any url parameters so that it will show All Prints.
If I just had a simple PageLink I could just set parameters="{'tag'='All'}"
but  the menu links come from a database so they can be dynamically added.
I did get it to work as I wanted by adding a context of 'All' the pagelink
and then set tag to null in begin render. The only think I don't like about
that is the URL ends up being:

/studio/work/All?tag=Paris (best case would be /studio/work?tag=All which I
don't really care for either)

I suspect I'll really fix this by hardcoding a URL in the database and just
using <a href="/studio/work/"> but that seems wrong.

I guess it comes down to what PageLink should do. I view it as a way to go
to some arbitrary page with a set of arguments I specify. I'm OK with
leaving context and parameters empty and Tapestry providing defaults but it
seems like if I supply a value it should use that and only that. I suppose
there may be other cases where this functionality is useful but I can't
think of any off hand. Perhaps if parameters="null" or parameters="{}"
would just remove all parameters that might be OK and would solve the
common case of:

1. A menu item linking to a page that shows a bunch of things
2. The page has search parameters to narrow the list and uses ARP to store
them

The menu link does not need to know (and should not know) what the possible
set of search criteria is, it just wants to turn them all off. The search
page can handle them using EventLink to clear individual ones.



On Wed, May 8, 2013 at 7:06 PM, Howard Lewis Ship <hls...@gmail.com> wrote:

> I suspect you are using @ActivationRequestParameter annotatations and that
> is the source of your "sticky" query parameters.
>
> It may be a bug that you explicitly supply an empt parameters map to the
> PageLink and it still adds the ARP in, but that is likely a feature.
>
> To accomplish what you want, you may need to set the ARP fields to null
> inside beginRender().
>
>
>
> On Wed, May 8, 2013 at 6:02 AM, Barry Books <trs...@gmail.com> wrote:
>
> > I've got a menu item generated from a database with a pagelink like this
> >
> > <t:pagelink page="prop:drop.page" context="dropContext"
> > style="${drop.style}"
> > >${drop.label}</t:pagelink>
> >
> >
> > I've added a search function to one of the linked pages that adds
> > parameters to the URL with
> >
> >
> > <t:pagelink ...  parameters="search">Page</t:pagelink>
> >
> >
> > I'd like to make the menu item clear the search so I tried this:
> >
> >
> > <t:pagelink page="prop:drop.page" context="dropContext" style="${drop
> > .style}" parameters="{}">${drop.label}</t:pagelink>
> >
> >
> > but it does not work. It seems Tapestry is clever enough to always add my
> > search criteria to the parameter map. This would be easy enough to fix if
> > my menu was not driven from a database but I don't see an easy to make my
> > generic menu know how to fix this.
> >
> >
> > It would seem useful to be able to say <t:pagelink ...
> > parameters="null">Page</t:pagelink> but parameters cannot be set to null.
> >
> >
> > Any suggestions?
> >
>
>
>
> --
> 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
>

Reply via email to