tags:

views:

38

answers:

0

I have developed a custom JSF component and looking for ways to implement custom event listeners for it in following way

<custom:comp attr1="abc" attr2="xyz" onEvent1="${bean.processEvent1}" />

Here custom is my custom component namespace & comp is custom component tag name

So far I have found following information regarding events in JSF

  1. actionListener attribute or f:actionListener tag - It can only be used with component that implements ActionSource such as CommandButton or CommandLink
  2. valueChangeListener or f:valueChangeListener tag - It is used with input components
  3. f:ajax tag - It can support only DOM events

That leaves me with ClientBehavior and ClientBehaviorHolder API. Even then I am going to deal wtih having another tag sort of

<custom:compEvent name="onEvent1" listener="${bean.processEvent1}"

Is there any way so that I can define inline event-to-listener mapping for my custom component?