I must be going crazy.

On the 5.0.18 docs for component
rendering<http://tapestry.apache.org/tapestry5/guide/rendering.html>,
it clearly states that in setupRender(), "This is a good place to read
component parameters and use them to set temporary instance variables.".

So I did exactly that. I made a Foo page (with simple tml), with an embedded
Bar component (with simple tml) that takes a required parameter called
barParam of type String. I bound barParam in Foo's setupRender to
"someString". In Bar's *setupRender*(), I set a breakpoint, and voila,
barParam is null. Amazingly, I set a breakpoint in *beginRender*(), and
barParam is properly set to "someString". Am I missing something???

Second question -- if an embedded component handles an event, i.e.
onActionFromHello, it appears that bound parameters from initial page render
are lost on subsequent calls straight to the url, i.e
http://example.com/foo.bar:hello (as this would happen in AJAX). As I
understand it, the only way to keep this persistent between subsequent AJAX
calls would be using @Persist?

Third question: event methods can be placed on pages, not just components,
right? i.e if on page Foo i want to bind to the event Hello, i just add
"void onActionFromHello() { //blah blah }" and I should be able to trigger
that event by hitting http://example.com/foo:hello , right? That doesnt seem
to work, it complains with "Request event 'hello' (on component foo) was not
handled; you must provide a matching event handler method in the component
or in one of its containers."... I don't have to do anything else, right?

Thanks,
Jason

Reply via email to