[
https://issues.jboss.org/browse/RF-12182?page=com.atlassian.jira.plugin.s...
]
Nick Dev updated RF-12182:
--------------------------
Workaround Description:
Workaround is to trigger "change" event from inputchange/inputblur events on
client-side.
Helper JS function:
{code}
function invokeCalendarOnChange(event, id) {
var c = RichFaces.$(id);
c.invokeEvent("change", RichFaces.getDomElement(c.id), event, c.selectedDate);
}
{code}
Usage:
{code}
<rich:calendar
oninputchange="invokeCalendarOnChange(event,'#{rich:clientId('calendar')}');"
id="calendar" enableManualInput="true"
value="#{testBean.calendarDate}">
<a4j:ajax event="change"
listener="#{testController.dateChanged}" render="out" />
</rich:calendar>
{code}
was:
Workaround is to leave "change" event and trigger it on client-side from
inputchange, inputblur events.
Helper JS function:
{code}
function invokeCalendarOnChange(event, id) {
var c = RichFaces.$(id);
c.invokeEvent("change", RichFaces.getDomElement(c.id), event, c.selectedDate);
}
{code}
Usage:
{code}
<rich:calendar
oninputchange="invokeCalendarOnChange(event,'#{rich:clientId('calendar')}');"
id="calendar" enableManualInput="true"
value="#{testBean.calendarDate}">
<a4j:ajax event="change"
listener="#{testBeanController.dateChanged}" render="out" />
</rich:calendar>
{code}
Steps to Reproduce:
{code}
<h:form id="testform" >
<rich:calendar id="calendar" enableManualInput="true"
value="#{testBean.calendarDate}">
<a4j:ajax event="change"
listener="#{testController.dateChanged}" render="out" />
<a4j:ajax event="inputchange"
listener="#{testController.dateChanged}" render="out" />
</rich:calendar>
<h:inputText />
</h:form>
<h:outputText id="out" value="#{testBean.calendarDate}" />
<rich:messages ajaxRendered="true" />
{code}
Select date with pop-up - listener is invoked.
Enter valid date with keyboard and switch focus - listener is not invoked.
was:
{code}
<h:form id="testform" >
<rich:calendar id="calendar" enableManualInput="true"
value="#{testBean.calendarDate}">
<a4j:ajax event="change"
listener="#{testBeanController.dateChanged}" render="out" />
<a4j:ajax event="inputchange"
listener="#{testBeanController.dateChanged}" render="out" />
</rich:calendar>
<h:inputText />
</h:form>
<h:outputText id="out" value="#{testBean.calendarDate}" />
<rich:messages ajaxRendered="true" />
{code}
Select date with pop-up - listener is invoked.
Enter valid date with keyboard and switch focus - listener is not invoked.
a4j:ajax listener does not work with rich:calendar (inputchange,
inputblur events)
----------------------------------------------------------------------------------
Key: RF-12182
URL:
https://issues.jboss.org/browse/RF-12182
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: component-input
Affects Versions: 4.2.1.Final
Environment: JSF Mojarra 2.1.7
Reporter: Nick Dev
a4j:ajax listener does not work with rich:calendar (inputchange, inputblur events).
AJAX request is fired but listener is not called.
Works only for "change" event.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira