I use a calendar in h:commandButton. I need to update a PanelGroup based on the date selected from the commandButton (calendar). The corresponding code is as follows:
<h:commandButton styleClass="ui-tabs calendar-icons" onclick="generateCalender()">
<f:setPropertyActionListener target="dateValue" value="true"></f:setPropertyActionListener>
</h:commandButton>
<c:set var="formattedDate" value="#{dateValue == 'true' ? formatDate : currentDate}"/>
Each time i select a date, the panelGroup must be updated. But the page gets refreshed each time I clicked the button because the type = "submit" is the default type for h:commandButton. If I use the type = "button", f:setPropertyActionListener is not working.
Is there any way other than using f:setPropertyActionListener to set values when the command button is clicked and set the value for formattedDate based on the obtained value?