这是我写的代码
<p:calendar mindate="#{BackingBean.displayMinimumDate}" requiredMessage="This calendar field is required" value="#{BackingBean.displayCurrentDate}" id="calendarRevoteId" disabled="#{BackingBean.showingRevoteCalendarField}" valueChangeListener="#{BackingBean.processValueChange}"></p:calendar>
我写过radiobutton
<h:form id="form">
<p:selectOneRadio id="resultVotingAction" value="#{votingResult.stakeHolderVoteVO.votingResult}"
rendered="#{votingResult.renderVotingOption}" styleClass="votingRadioControl">
<f:selectItem itemLabel="Approve" itemValue="Approve" />
<f:selectItem itemLabel="Reject" itemValue="Reject" />
<f:selectItem itemLabel="Request More Info" itemValue="Request More Info" />
<f:selectItem itemLabel="Revote" itemValue="Revote" />
<p:ajax listener="#{BackingBean.renderingCalendar}" update="form:calendarRevoteId"/>
</p:selectOneRadio>
</h:form>
我得到的问题是processValuechange方法调用第二次点击,一切正常,首先点击它不工作
答案 0 :(得分:0)
尝试将showOn="Button"
添加到您的日历中。这是Primeface&#34;客户端事件,显示弹出日历&#34;。
<p:calendar showOn="Button"
mindate="#{BackingBean.displayMinimumDate}"
requiredMessage="This calendar field is required"
value="#{BackingBean.displayCurrentDate}"
id="calendarRevoteId"
disabled="#{BackingBean.showingRevoteCalendarField}"
valueChangeListener="#{BackingBean.processValueChange}">
</p:calendar>