On Tue, 02 Jul 2013 17:08:24 -0300, Lance Java <lance.j...@googlemail.com> wrote:

Ah, gotcha. Can you elaborate on this complicated logic?

Hmm, that complicated logic will be complicated. :P Tapestry has basically three ways of passing data between components, mixins and pages:

1) Component and mixin parameters (top-down in the component hierarchy tree)
2) Events (bottom-up)
3) Environment service (both top-down, such as Form pushing FormSupport into the Environment; and bottom-up, such as when a Field implementation puts actions in the FormSupport instance pulled from Environment)

Lance's scenario isn't top-down nor bottom-up. It's a little bit sideways. The easiest solution would be what Cezary suggested. Otherwise, you'd need to catch the events up in the hierarchy and somehow invoke the handler methods in PagerContainer directly, and that's ugly and non reusable.


On 2 Jul 2013 20:30, "Cezary Biernacki" <cezary...@gmail.com> wrote:

Hi Lace,

PagerContainer is not a parent to Pager.
Pager is part of PageDemo page.
It is just rendered in body of of PagerContainer,
but it is not belong to PagerContainer,  they do not form any hierarchy.
That is why the event bubbling seems not to work in this case.

You would need more complicated logic to handle such configuration,
if you can not include Pager directly in PagerContainer.

Best regards,
Cezary



On Tue, 2 Jul 2013 20:11:17 +0100 Lance Java <lance.j...@googlemail.com>
wrote:

Ok, I'm totally stumped.

Event bubbling works here:
http://tapestry-stitch.**uklance.cloudbees.net/**eventbubbledemo<http://tapestry-stitch.uklance.cloudbees.net/eventbubbledemo>

But doesn't work here:
http://tapestry-stitch.**uklance.cloudbees.net/**pagerdemo<http://tapestry-stitch.uklance.cloudbees.net/pagerdemo>

I have eventlinks in Pager.tml
    <t:eventlink event="event1">Event1</t:**eventlink><br />
    <t:eventlink event="event2">Event2</t:**eventlink><br />
    <t:eventlink event="event3">Event3</t:**eventlink><br />

And I have handlers in PagerContainer.java
@OnEvent("event1")
void onEvent1() {
System.out.println("Event 1");
}
  boolean onEvent2() {
System.out.println("Event 2");
return true;
}

Object onEvent3() {
System.out.println("Event 3");
return this;
}

Source code viewable from the pages, any help appreciated.


On 2 July 2013 18:55, Lance Java <lance.j...@googlemail.com> wrote:

 Hmm... I've stripped my example down to it's bare bones and events are
now
bubbling up... I must be doing something stupid in my original code.
And yes, the parent component is in the components package, it's in
mybasepackage.components.


On 2 July 2013 16:19, Howard Lewis Ship <hls...@gmail.com> wrote:

This is odd; it feels like something in Tapestry that's too rock-solid
to
fail. Is there any chance the parent class is not being instrumented as
a
component class? What package is it in?


On Tue, Jul 2, 2013 at 1:58 AM, Lance Java <lance.j...@googlemail.com

wrote:
As I said in my previous message, I've tried triggerEvent on the
ComponentResources and ComponentResources.**getContainerResources().

Neither

bubble up to the parent.



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




--
Thiago H. de Paula Figueiredo

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

Reply via email to