Thiago H. de Paula Figueiredo wrote:
> On Mon, May 18, 2009 at 11:48 AM, Andy Buckley
> <andy.buck...@durham.ac.uk> wrote:
>> <a href="#" t:type="pagelink" t:page="view" t:context="literal:xml">XML</a>
>>
>> but as mentioned elsewhere in the thread, this generates a URI without
>> the parent page's context (which magically still works), i.e. the URI
>> generated by the above is
>> .../view/xml
>> rather than the hoped-for
>> .../view/p1234/xml
> 
> You'll need to pass the full context (normal parameters + format parameter):
> <a ... t:context="xmlContext">
> 
> public Object getXmlContext() {
>     List list = new ArrayList(); // or Map
>     list.add(parameter1);
>     list.add(parameter2);
>     list.add("xml");;
> }
> 
> Of course, as you have the same proper context (without format
> parameter) in more than one method, you'll refactor the above method.
> Was the example good?

Yes, that's great, thanks. It would be nice if "inheriting" the context
from the linking page in the link URI could be automated e.g.:

<a ... t:inheritcontext="true" t:context="literal:xml">

especially since I want to be able to generate a lot of these context
links for the different dataset, x, y axis numbers. I've managed to hack
something for now which will do.

One final, final (I hope) thing: the decoded context appears to be
shared between pages using the same session, which I notice if I have
two browser tabs viewing different records. If I view one tab/page as a
single dataset, or in XML format (in each case, this corresponds to an
extra context parameter), then reloading the other will be rendered as
if that extra parameter was present. Any idea what would be causing this
and how to stop it? The parameter values are accessed via this map and
method:

    private Map<String,String> _params = new TreeMap();
    public String getQueryParam(String param) {
        return _params.get(param);
    }

Do I need to annotate these somehow to tell them to not be shared
between instances of the page?

Andy

-- 
Dr Andy Buckley
Institute for Particle Physics Phenomenology
Durham University
0191 3343798 | 0191 3732613 | www.insectnation.org

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

Reply via email to