Announcement Announcement Module
No announcement yet.
Flow action event not triggered from a4j:support Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Flow action event not triggered from a4j:support

    I have an h:inputText tag incorporating an a4j:support tag with the action attribute set equal to a transition on the corresponding view and the event="onchange". When I change the text and move focus to another field an ajax request is sent (can see this in a4j:log, Tomcat log as well as by debugging since the evaluate expression in the on-render tag of the view state executes. However the transition which contains an evaluate expression is not executed. This can be determined through debugging as well as the DebugFlowExecutionListener not showing the eventSignaled.

    I have other RichFaces ajax requests working okay including an a4j:commandLink and another a4j:support on an h:selectOneMenu tag.

    Any ideas why I'm having this problem?

    Environment is -
    • Tomcat 6
    • MyFaces 1.2.6
    • Spring 2.5.5
    • Spring Webflow 2.0.7
    • RichFaces 3.3.0
    • facelets-1.1.14

    I've included some relevant code snippets here. Let me know if there is more you wish to see.

    Flow definition -
        <view-state id="startStationMaintenance" model="maintReport"
                <evaluate expression="flowScope.remove('maintActivity')"/>
                <evaluate expression="maintReport.getMaintenanceActivities()" result="flowScope.activityList" result-type="dataModel" />
            <transition on="createStart">
                <evaluate expression="stationMaintenanceActions.addStartMaintenance(maintReport)" />
            <transition on="addMaintenanceActivity" to="createMaintenanceActivity">
                <evaluate expression="stationMaintenanceActions.addMaintenanceActivity(stationMaintenanceBean, maintReport)" result="flowScope.maintActivity"/>
            <transition on="editMaintenanceActivity" to="editMaintenanceActivity" >
               <set name="flowScope.maintActivity" value="activityList.selectedRow" /> 
            <transition on="removeMaintenanceActivity" validate="false" >
                <evaluate expression="maintReport.removeMaintenanceActivity(activityList.selectedRow)" />
                <render fragments="activitiesList" />
         	<transition on="save" to="currentReportList">
                <evaluate expression="stationMaintenanceActions.addMaintenanceReport(station, maintReport, messageContext)" />
            <transition on="cancel" to="currentReportList" validate="false" bind="false">
                <evaluate expression="stationMaintenanceActions.removeMaintenanceReport(station, maintReport)"/>
    Page snippet -
            <ui:define name="beginTime" >
                <ui:fragment rendered="#{ == null}" >
                    <h:inputText value="#{maintReport.startTime}" id="startTime" label="Start Time">
                        <f:convertDateTime pattern="#{resourceBundle['maintenanceReport.timeStampPattern']}" timeZone="#{maintReport.timeZone}" />
                        <rich:beanValidator summary="Start Time" />
                        <a4j:support event="onchange" action="createStart" ajaxSingle="true" reRender="activitiesList"/>
                    <input type="button" onclick="showCal(this, '%j %M %Y %H:%i');" value="..." />
                    <h:outputText value="  (#{resourceBundle['maintenanceReport.timeStampPattern']})"/>
                    <rich:toolTip for="startTime" value="#{resourceBundle['maintenanceReport.toolTip.startTime']}"/>
                    <rich:message for="startTime" styleClass="fieldError" />
                <h:outputText rendered="#{ != null}"
                     <f:convertDateTime pattern="dd MMM yyyy HH:mm" timeZone="#{maintReport.timeZone}"/>
    The createStart action/transition is not executed.

    I have tried variations using the #{flowRenderFragments} variable as documented in the reference to no avail. I have also simplified the page, as a test, by creating an unconditionally rendered inputText field before the </ui:define> tag with a similar a4j:support and the problem still occurs.

    I have not included web.xml or the webflow-config.xml since, as I stated above, I have other Richfaces ajax calls triggering flow events working fine and therefore believe my configuration is correct. However if you would still like to see these let me know.


  • #2

    Got it! Needed to specify validate="false" on the transition.


    • #3
      a4j:support not working on mine

      Hi lsnett,

      Can you please provide more detail on it, so that i can run mine one too,
      Please help i think u have solved it already..

      Pblm detail is on

      Thanks in advance


      • #4
        Originally posted by lsnett View Post
        Got it! Needed to specify validate="false" on the transition.
        What if you have required fields that need to be present in this transition? I mean the required="true" attribute in the component declaration. It causes same behavior... <a4j:support event="onchange" /> stops working after returning to input with validation erros.

        Any workaround?