You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/05/17 13:09:35 UTC

t5: component events?

Hi,

I'm writing a component, the component requires its container to format a
string before rendering completely, say, it needs to call a method:

String makeLink(Integer pageNo)

and makeLink should be defined by the container of the component, I'm
thinking of event bubbling can take care of this, but don't know how to
proceed, any ideas?

Thanks,

Angelo
-- 
View this message in context: http://www.nabble.com/t5%3A-component-events--tp23582296p23582296.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5: component events?

Posted by Christian Senk <da...@gmx.de>.
I think the builtin Autocomplete mixin does something like that.

ComponentEventCallback callback = new ComponentEventCallback()
{
	public boolean handleResult(Object result)
	{
		List matches = coercer.coerce(result, List.class);

		matchesHolder.put(matches);
		return true;
	}
};

resources.triggerEvent(EventConstants.PROVIDE_COMPLETIONS, new Object[] { input }, callback);


The event is triggered in the component container.
Greeting, Christian

Angelo Chen schrieb:
> Hi,
>
> I'm writing a component, the component requires its container to format a
> string before rendering completely, say, it needs to call a method:
>
> String makeLink(Integer pageNo)
>
> and makeLink should be defined by the container of the component, I'm
> thinking of event bubbling can take care of this, but don't know how to
> proceed, any ideas?
>
> Thanks,
>
> Angelo
>