Re: Recommended way to instantiate EventContext

Peter Hvass <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAOemSub_UdK3_bak8Gjfuc+vmXZYXNAEqSOij3=qZjPpdP+P8g@mail.gmail.com>
Hey again!

Are you trying to pass a value to the context parameter of an eventlink by
any chance?

You can just use any old properties in Java classes - either the Tapestry
way with an @Property attached to a field or a public getter of any old
type. If it's anything beyond standard Java types (i.e.: string, int,
double etc.) then you'll need to provide a bit of extra code to pass it in
as context. For multiple context items you would use square brackets.

i.e.:
@Property
private String somevalue;

<t:eventlink event="foo" context="somevalue">Foo</t:eventlink>

void onFoo(String someValue) {

}

----or-----

@Property
private String bar;

@Property
private Integer baz;

<t:eventlink event="foo" context="[bar, baz]">Foo</t:eventlink>

void onFoo(String bar, Integer baz) {

}

Is that sort of what you're looking for?

Thanks,
Peter



On 28 November 2016 at 19:13, Adam X <[email protected]> wrote:

> Howdy again!
>
> So what's the approved Tapestry way to create an instance of this
> interface?
>
> Adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.