Announcement Announcement Module
Collapse
No announcement yet.
Flow action event not triggered from a4j:support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 -
    Code:
        <view-state id="startStationMaintenance" model="maintReport"
        	view="/startStationMaintenanceView.xhtml">  
            
            <on-entry>
                <evaluate expression="flowScope.remove('maintActivity')"/>
            </on-entry>
            
            <on-render>
                <evaluate expression="maintReport.getMaintenanceActivities()" result="flowScope.activityList" result-type="dataModel" />
            </on-render>
            
            <transition on="createStart">
                <evaluate expression="stationMaintenanceActions.addStartMaintenance(maintReport)" />
             </transition>
                  
            <transition on="addMaintenanceActivity" to="createMaintenanceActivity">
                <evaluate expression="stationMaintenanceActions.addMaintenanceActivity(stationMaintenanceBean, maintReport)" result="flowScope.maintActivity"/>
            </transition>
                   
            <transition on="editMaintenanceActivity" to="editMaintenanceActivity" >
               <set name="flowScope.maintActivity" value="activityList.selectedRow" /> 
            </transition>
            
            <transition on="removeMaintenanceActivity" validate="false" >
                <evaluate expression="maintReport.removeMaintenanceActivity(activityList.selectedRow)" />
                <render fragments="activitiesList" />
            </transition>
           
         	<transition on="save" to="currentReportList">
                <evaluate expression="stationMaintenanceActions.addMaintenanceReport(station, maintReport, messageContext)" />
            </transition>
            
            <transition on="cancel" to="currentReportList" validate="false" bind="false">
                <evaluate expression="stationMaintenanceActions.removeMaintenanceReport(station, maintReport)"/>
            </transition>
        </view-state>
    Page snippet -
    Code:
            <ui:define name="beginTime" >
                <ui:fragment rendered="#{maintReport.id == 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"/>
                    </h:inputText>
                    <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" />
                </ui:fragment>
                <h:outputText rendered="#{maintReport.id != null}"
                              value="#{maintReport.startTime}">
                     <f:convertDateTime pattern="dd MMM yyyy HH:mm" timeZone="#{maintReport.timeZone}"/>
                </h:outputText>
     
            </ui:define>
    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.

    Thanks,
    Lee

  • #2
    validate=&quot;false&quot;

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

    Comment


    • #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 me...as i think u have solved it already..

      Pblm detail is on

      http://forum.springsource.org/showthread.php?t=82106

      Thanks in advance
      Mabimal

      Comment


      • #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?

        Comment

        Working...
        X