Click here to Skip to main content
11,805,604 members (47,299 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Java event JSF
Hi, I've a composite with calendar component inside. I need to catch an event when calendar was changed but in my mainBean (not composite bean).
So, I've got 4 files:, main.xhtml and coposite: myCalendar.xhtml with I want to call 'changed' event in and have no idea how to achive that.

Here is the code:

<composite:interface componentType="myComponent">
    <composite:attribute name="value" required="true"/>
            method-signature="void listener()" />
    <h:panelGroup id="container">
            <p:ajax event="dateSelect"  update="@this,:buttonpanel" listener="#{cc.attrs.myListener}"/>

Main page:

<cc:inputdate value="#{mainBean.item.myDate}" myListener="#{mainBean.event1}"/>

bean for main page:

public void event1()

I've got also log in setMyDate() method. So I now exactly when mainBean has new date set.

In composite's bean there is only "log code", but It was enough to see that Event1 was called before the new value was set..

My question is: How can I catch an event, that will be called AFTER the value for myDate is set? In that event I want to do "getMyValue" with new value. Thanks for help.
Posted 23-Mar-13 16:32pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 300
1 Richard Deeming 225
2 Sergey Alexandrovich Kryukov 170
3 ppolymorphe 125
4 CPallini 120
0 OriginalGriff 3,265
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100