Well you'll have to use JavaScript to actually catch the onchange event.
You should be able to just do:
<t:inputDate ... onchange="submit();" >
<t:valueChangeListener value="#{backingBean.onDateChanged}" />
</t:inputDate>
And then in you onDateChanged() method, calculate the days and set that
components value.
Kieron Wilkinson wrote:
Hi,
I am working on a holiday booking application for our Intranet, and I am
trying to do something, but I am not sure if it is possible or not.
Basically, the user enters two dates using the Tomahawk calendar (popup
version), the start of their holiday, and the end of their holiday, and
there is a field which shows how many business days (excluding bank
holidays and weekends) between that date range, so the user knows how
many days they are actually booking off.
The problem is that I want that field to update dynamically (without
using Javascript), so when the user has selected the two dates, the
number of business days will appear in the box immediately. Therefore I
guess I need the calendar component to trigger an action / POST of the
form information when a date is selected.
The question is, can I get it to do that?
I have searched through the mailing list, documentation, and Google, and
I can't find anything like it... I guess if it can't be done, I guess I
can resort to some kind of "calculate days" button, but I would rather
not do! :)
I am using the 1.2 reference implementation of JSF with Facelets and the
latest Tomahawk.
Thanks in advance for any help!
Kieron Wilkinson
============================
Pareto Investment Management Limited is a Mellon Financial Company. Pareto
Investment Management Limited is authorised and regulated by the Financial
Services Authority (Firm Ref. No. 416024), and registered in England and Wales
with Number 03169281. Registered Office: Mellon Financial Centre, 160 Queen
Victoria Street, London EC4V 4LA, United Kingdom. Pareto is the registered
trademark of Pareto Investment Management Limited. This message may contain
confidential and privileged information and is intended solely for the use of
the named addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorised. If you are not the
intended recipient please notify us immediately by returning the e-mail to the
originator and then immediately delete this message.