Announcement Announcement Module
Collapse
No announcement yet.
JSF ajax events handling in Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSF ajax events handling in Spring

    I am using Primefaces 3.4, Mojarra 2.1 and cannot get ajax events to work properly. Consider the following example:

    Code:
    <p:dataTable id="customersTable" value="#{customersList}" var="customer">
        <p:ajax event="rowToggle" update="customersTable,:globalGrowl" /> 
        <p:column headerText="Name">
            <h:outputText value=" #{customer.name}"></h:outputText>
        </p:column>
        <p:column headerText="Documents">
            <p:rowToggler></p:rowToggler>
        </p:column>
        <p:rowExpansion>
            <p:dataTable id="docsTable" value="#{customer.docs}" var="doc" >
                <p:column headerText="Document Number">
                    <h:outputText value="#{doc.docNum}"></h:outputText>
                </p:column>
            </p:dataTable>
        </p:rowExpansion>
    </p:dataTable>
    Row toggle sends ajax event to the backend and expects reformatted table back with the row expanded. Spring instead sends back only the state variable.

    I can sort-of make this work by chaining ajax event with RemoteCommand component which actually triggers Spring webflow action and I can use fragment rendering there. This requires at least 2 ajax requests, and it still does not render properly - might be PF/SWF integration issue I suspect.

    Anyway, is there a way to make Spring honor those Ajax event requests? I wonder how these work in pure JSF/Primefaces as their examples do not show any specific processing being done for such a rowToggle event, yet it still renders properly on their end...

    Peter
Working...
X