Announcement Announcement Module
Collapse
No announcement yet.
Problems using Primefaces + Webflow with p:Ajax Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems using Primefaces + Webflow with p:Ajax

    Hi there,
    We're using Primefaces + Webflow and Im having some problem to get my Ajax-request go through Webflow.
    I can make it work when using a p:commandButton but not with p:ajax. Should they not work the same or am I missing something?

    I can make p:ajax "talk" to a backing-bean but since Im using Webflow my plan was that all service-calls should be handled by webflow. Is this possible?

    Here's an example!

    searchinput.xhtml:
    Code:
    <p:panel id="searchPanel" header="Search customer">         
    
             CustomerIdfromTextInput: <h:inputText value="#{searchForm.customerIdfromTextInput}" />
             <p:commandButton value="Fetch customer" action="flowCommandAction" update="customerInfoPanel"/>
             
             <br />
             CustomerIdfromRadioInput: 
             <h:selectOneRadio value="#{searchForm.customerIdfromRadioInput}" >
                <f:selectItem itemLabel="Customer 1" itemValue="1"/>
                <f:selectItem itemLabel="Customer 2" itemValue="2"/>
                <f:selectItem itemLabel="Customer 3" itemValue="3"/>
                
                <p:ajax action="flowRadioAction" update="customerInfoPanel"/>            
             </h:selectOneRadio>
    
          </p:panel>
          
          <p:panel id="customerInfoPanel" header="Customer information">
             Firstname: <h:outputText value="#{customer.firstName}"/><br/>
             Lastname: <h:outputText value="#{customer.lastName}"/><br/>
             CustomerId: <h:outputText value="#{customer.id}"/><br/>
          </p:panel>
    flow.xml:
    Code:
       <view-state id="searchinput" model="searchForm">
          <transition on="flowCommandAction">         
             <evaluate expression="customerService.getCustomer(searchForm.customerIdfromTextInput)" result="flowScope.customer"/>
          </transition>
          <transition on="flowRadioAction" validate="false">
             <evaluate expression="customerService.getCustomer(searchForm.customerIdfromRadioInput)" result="flowScope.customer"/>
          </transition>      
       </view-state>
    When I'm clicking the "commandButton" the call is handled by webflow.. but when I click the radiobutton the call "is lost" on the server!

    We're using:
    Primefaces 2.2.1
    WebFlow 2.2.1
    Spring 3.0.5
    Mojarra 2.0.3 (SNAPSHOT 20100726)

  • #2
    I have the same problem, can someone help me?

    Comment


    • #3
      I have the same problem, could you find a solution?

      Comment


      • #4
        Write a controller with method:
        public void runAction(String eventId) {
        FacesContext.getCurrentInstance().getExternalConte xt().getRequestMap().put(JsfView.EVENT_KEY, eventId);
        }
        and then invoke:
        <p:selectOneMenu ...
        <p:ajax update="..." listener="#{controller.runAction('test')}" />
        <f:selectItem...
        of course you need to have transation 'test' in your view.

        Comment


        • #5
          It works, thank you very much!

          Comment

          Working...
          X