p:calendar doesn't update other controls

UI Components for JSF
Post Reply
macros14
Posts: 46
Joined: 26 Feb 2010, 19:44

10 Dec 2010, 00:01

I have the following code.

<h:panelGroup id="adjudicateRefund">
<h:selectOneMenu id="refundRequestedBy" value="#{refundBean.selectedRefund.requestedLpUser}" converter="#{lpUserEntityConverter}">
<f:selectItem itemLabel="Select"/>
<f:selectItems value="#{refundBean.institutionUserList}" var="user" itemLabel="#{user.fullName}" itemValue="#{user}"/>
</h:selectOneMenu>

<p:calendar readOnlyInputText="true" value="#{refundBean.selectedRefund.refundDate}" onSelectUpdate="adjudicateRefund" selectListener="#{refundBean.refundDate_Select}" required="false" requiredMessage="Refund Date is required."/>


</h:panelGroup>


If I first select something from the dropdown menu, and then select something via the calendar, my dropdown value is lost or never set. Is there a way to make the calendar ajax similar to others using <p:ajax> so when an event happens to the calendar everything inside of my "adjudicateRefund" is updated?

robert.m
Posts: 226
Joined: 07 Dec 2010, 22:52
Location: Salzburg/Austria

10 Dec 2010, 00:42

Maybe you have to add a <h:form id="form"> to wrap your panelGroup and then set the onSelectUpdate of the calendar to "form:adjudicateRefund". This resolved some of my issues with components not updating.

Hope this helps, didn't test it myself though

michaelb
Posts: 23
Joined: 23 Jul 2010, 14:25

06 Jan 2011, 16:02

Does your listener even get called?

lapras
Posts: 1
Joined: 21 Jan 2011, 11:58

25 Jan 2011, 13:07

I use the PrimeFaces 2.2RC but I have the same issue. I tried without listener to update the component inside a form as desribed above but id doesn't solved my problem. I wonder why doesn't work it but I suspect the problem is somewhere around the component id generation.


The same scenarios is worked for me if I tried on p:panel update with a p:commandLink.

Any idea?



[Update]
Thank you the fast repsond. ;)
Last edited by lapras on 25 Jan 2011, 13:21, edited 1 time in total.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Jan 2011, 13:13

This is expected because calendar select only processes itself and ignores other components. I think we need to add onSelectProcess attribute to make this flexible, I've seen a similar case in another post.

See http://code.google.com/p/primefaces/iss ... il?id=1668

I'll add this now.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Jan 2011, 13:27

Done;

http://code.google.com/p/primefaces/iss ... il?id=1668

Now this should work;

Code: Select all

<h:panelGroup id="adjudicateRefund">
<h:selectOneMenu id="refundRequestedBy" value="#{refundBean.selectedRefund.requestedLpUser}" converter="#{lpUserEntityConverter}">
<f:selectItem itemLabel="Select"/>
<f:selectItems value="#{refundBean.institutionUserList}" var="user" itemLabel="#{user.fullName}" itemValue="#{user}"/>
</h:selectOneMenu>

<p:calendar readOnlyInputText="true" value="#{refundBean.selectedRefund.refundDate}" onSelectUpdate="adjudicateRefund" onSelectProcess="@this adjudicateRefund" 
selectListener="#{refundBean.refundDate_Select}" required="false" requiredMessage="Refund Date is required."/>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests