Problem with calendar in inplace Element

UI Components for JSF
Post Reply
SKN
Posts: 1
Joined: 05 May 2011, 15:12

05 May 2011, 15:28

Hello,

i have got a problem using a calendar in an inplace Element. My html code looks like that:

Code: Select all

...
<p:inplace id="dataInplace" label="#{DataDetails.labels.date}" effectSpeed="fast">
   <p:calendar id="date" value="#{DataDetails.date}" showOn="button" pattern="yyyy-MM-dd" validator="#{DataDetails.checkDate}" onkeyup="save.enable()" onchange="save.enable()" />
   <h:message for="date"/>
</p:inplace>
...
What it shows before editing: Sun May 01 00:00:00 CEST 2011
What it should show and shows during editing: 2011-05-01

Is it a known bug or limitation that calendar does not format its pattern correctly for inplace editing (Just like rendering the spinner buttons)? Is there a workaround?

Thanks for your help,
Sebastian

ryan.bennett.au
Posts: 4
Joined: 18 Jun 2011, 23:34

31 Aug 2011, 06:58

I just hit the same problem. The inplace renderer looks for a converter to display the text. The pattern attribute on the Calendar is not registered as a converter (maybe you could raise this as an issue). Update your code with the following and it should work

Code: Select all

<p:inplace id="dataInplace" label="#{DataDetails.labels.date}" effectSpeed="fast">
   <p:calendar id="date" value="#{DataDetails.date}" showOn="button" pattern="yyyy-MM-dd" validator="#{DataDetails.checkDate}" onkeyup="save.enable()" onchange="save.enable()" >
       <f:convertDateTime pattern="yyyy-MM-dd" />
   </p:calendar>
   <h:message for="date"/>
</p:inplace>
Cheers

Ryan

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests