immediate="true" ineffective on p:calendar (2.2M1)

UI Components for JSF
Post Reply
ringerc
Posts: 11
Joined: 23 Aug 2010, 08:39

29 Aug 2010, 15:28

Hi

I'm using PrimeFaces 2.2M1 (to avoid an issue with markup handling in dataTable) and I'm finding that calendars don't seem to be sending updates immediately when immediate="true" is set. As I'm using a JSF2 page with ajax handlers to update a search results table as the user changes the search criteria, it's somewhat problematic.

All my regular JSF2 controls respect immediate="true" and do ajax calls to set properties whenever they're changed, triggering an onchange event that an f:ajax tag uses to reload the search results.

If I remove my f:ajax tags and add a commandButton to submit the page, the properties bound to the calenders are set.

Does PrimeFaces require some additional infrastructure or some kind of additional markup to support immediate properties?

ringerc
Posts: 11
Joined: 23 Aug 2010, 08:39

29 Aug 2010, 16:28

In case anyone else runs into issues with immediate updates and finds the earlier post with Google / forum search: I found that a valueChangeListener didn't work either. It looks like the calendar might not be firing the standard jsf2 value change events or interacting with jsf2 ajax at all.

As a workaround I'm using the PrimeFaces-specific:

Code: Select all

   p:calendar selectListener="#{myModel.someHandler}" onSelectUpdate="theForm:someComponent"
... which seems to work OK, not breaking the JSF2 ajax code in the rest of the page. Being able to use "immediate" and handle the change event with f:ajax like the rest of the components would be ideal, but this works in the mean time. It's a whole heck of a lot better than the current state of RichFaces 4, after all ;-)

The server-side select listener method has to return void and accept a single org.primefaces.event.DateSelectEvent argument. Which, oddly enough, doesn't follow the change event convention of having getOldValue and getNewValue; instead it just has a getDate() method to return the new value.

I'm probably missing something obvious about basic PrimeFaces usage with this issue, but the approach taken does work, though it requires extra server-side methods to handle value changes.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests