You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by atraver <at...@gmail.com> on 2008/09/05 03:45:58 UTC

Page activation contexts with blank values

I'm having trouble wrapping my head around how Tapestry handles page
activation contexts. Here's the deal:

I have an overview (index) page that lists objects from my database
represented by CommunityOverview.java (/communityoverview). Clicking on each
item in the list will take you to its individual details (show) page at
CommunityDetails.java by way of an activation context
(/communitydetails/34).

The listing page also has a form to filter the items on the list. This form
is just an input box where you're able to enter any amount of text in a
regexp-like fashion. For the sake of my learning Tapestry (I come from
Rails, so most of these concepts seem foreign to me, although I'm sure most
map somehow... I'm just not there yet), I'm doing this "the old fashioned
way" by way of submitting the form and re-rendering the results (not AJAX).

In theory, I'd like the list component (it's actually just a wrapper around
Tapestry's Grid component) on the overview page to handle the submission of
the filter request, and have the overview page re-rendered with the filter
applied.

Furthermore, I'd like the URL to respect the filter I've put in place
through some bookmarkable persistence (e.g.,
/communityoverview/?filter=production or /communityoverview/production).

The way I'm doing this currently is through a combination of
onActivate/onPassivate in the CommunityOverview page. The problem, however,
is that by default, the filter input box is empty (this is what I want), and
while Tapestry is handling the page correctly when a filter to the list has
been applied (i.e., /communityoverview/production), it errors out with
"Context values (which are added to the request URL) may not be null or
blank" when no filter has been applied (again, the page's default behavior),
presumably because it sees the onPassivate method on the page, but when that
occurs, the value is blank so you could end up with a URL like
/communityoverview// which would be A Bad Thing (not sure if I'm correct on
that or not, though).

The other issue I have to deal with, too, is that when the activation
context is NOT blank, any page links (in this case the navigation links in
my page's header) to the CommunityOverview page automatically get the filter
applied, and I just want those links to go to /communityoverview, not
/communityoverview/[whatever I just filtered on].

I have the feeling I'm missing something really simple, I just wish I knew
what!
-- 
View this message in context: http://www.nabble.com/Page-activation-contexts-with-blank-values-tp19323396p19323396.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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