Announcement Announcement Module
Collapse
No announcement yet.
p:commandLink / commandButton will not trigger transition within p:dataTable Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • p:commandLink / commandButton will not trigger transition within p:dataTable

    I have followed the 'booking-faces' example as far as setup goes. I need a link to go from a datatable row to a detail page. Something very simple that is represented by the 'reviewHotels.xhtml' page in the booking-faces example.

    No matter what I've tried, whenever I click the link in my datatable, nothing happens. I do not get an error, p:messages show nothing, and nothing is happening on the backend.

    Here are the relevant files:

    main-flow.xml

    Code:
    <flow xmlns="http://www.springframework.org/schema/webflow"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/webflow
            http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
    	
    	<view-state id="start" view="dashboard.xhtml" redirect="false" popup="false">
    		<on-render>
    			<evaluate expression="briefController.getAllBriefs()" result="viewScope.briefList" result-type="dataModel" />			
    		</on-render>	
    	
    		<transition on="displayBrief" to="displayBriefState">
    			<set name="viewScope.brief" value="briefList.selectedRow"/>
    		</transition>	
    			
    	</view-state>		
    
    	<view-state id="checkStatus" view="status.xhtml" />
    
    	<subflow-state id="displayBriefState" subflow="brief"/>
    
    </flow>
    Corresponding XHTML file:
    Code:
    <h2>Events</h2>
         <h:form>                        
    	  <p:dataTable value="#{briefList}" var="brief" rows="10"  styleClass="table table-bordered table-striped">
    	      	<p:column headerText="Event Name">
    	   		<p:commandLink action="displayBrief" value="#{brief.eventName}"/>
    	       	</p:column>
    	      	<p:column headerText="Type">
    	       		#{brief.eventType}
    	      	</p:column>
    	      	<p:column headerText="Start Date">
                  		#{brief.startDate}
                  	</p:column>
               </p:dataTable>	                        
         </h:form>

    spring-webmvc-config.xml

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:faces="http://www.springframework.org/schema/faces"
    	xsi:schemaLocation="
    		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    		http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.4.xsd">
    
    	<faces:resources />
    
    	<!-- Maps request paths to flows in the flowRegistry; e.g. a path of /hotels/booking looks for a flow with id "hotels/booking" -->
    	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
    		<property name="order" value="1"/>
    		<property name="flowRegistry" ref="flowRegistry" />
    		<property name="defaultHandler">
    			<!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named "intro" -->	
    			<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
    		</property>
    	</bean>
    
    	<!-- Maps logical view names to Facelet templates in /WEB-INF (e.g. 'search' to '/WEB-INF/search.xhtml' -->
    	<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    		<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
    		<property name="prefix" value="/WEB-INF/" />
    		<property name="suffix" value=".xhtml" />
    	</bean>
    
    	<!-- Dispatches requests mapped to org.springframework.web.servlet.mvc.Controller implementations -->
    	<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
    
    	<!-- Dispatches requests mapped to flows to FlowHandler implementations -->
    	<bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
    		<property name="flowExecutor" ref="flowExecutor" />
    	</bean>
    
    </beans>
    webflow-config.xml

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:webflow="http://www.springframework.org/schema/webflow-config"
           xmlns:faces="http://www.springframework.org/schema/faces"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
               http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
               http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">
    
    	<!-- Executes flows: the central entry point into the Spring Web Flow system -->
    	<webflow:flow-executor id="flowExecutor">
    		<webflow:flow-execution-listeners>
    			<webflow:listener ref="facesContextListener"/>
    			<webflow:listener ref="securityFlowExecutionListener" />
    		</webflow:flow-execution-listeners>
    	</webflow:flow-executor>
    	
    	<!-- The registry of executable flow definitions -->
    	<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices" base-path="/WEB-INF/flows">
    		<webflow:flow-location-pattern value="/**/*-flow.xml" />
    	</webflow:flow-registry>
    	
    	<!-- Configures the Spring Web Flow JSF integration -->
    	<faces:flow-builder-services id="facesFlowBuilderServices" development="true" />
    
    	<!-- Installs a listener that creates and releases the FacesContext for each request. -->
    	<bean id="facesContextListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener"/>
    	
    	<!-- Installs a listener to apply Spring Security authorities -->
    	<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
    
    </beans>
Working...
X