I want to pass several values an event link and then get those values back via the event listener.

If I specify the context to be an array (even an array of Hibernate objects), the context seems to work right. The url has each element of the array / list as a separate path component. That works great.

However, how do I get it working on the listener? I thought I could just put an array as the context parameter argument. All I seem to get is a coercion error. Is this not supported or am I doing it wrong?

This is using Tapestry 5.2.5:

URL:
http://my.web.site:8000/url.../start:test/1/2?t:ac=$N/$N

.tml:

<t:eventlink t:event="test" t:context="ids">Test</t:eventlink>

.java:

    public Long[] getIds() {
        Long res[] = new Long[2];
        res[0] = 1l;
        res[1] = 2l;
        return res;
    }

    public void onTest(Long [] ids) {
        for (Long id : ids)
            System.out.println(id);
    }

Error:

Exception in method com.myasd.billing.pages.Start.onTest(java.lang.Long[]) (at Start.java: 412), parameter #1: Could not find a coercion from type java.lang.String to type [Ljava.lang.Long;.
context
1
2
eventType
test

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



Reply via email to