Q:

sorting columns doesn't work anymore after adding ajax event

jsf Code:    
<p:dataTable styleClass="patientlistcolumns" id="patienttable" value="#{patientsBean.rows}" var="patientData"
emptyMessage="#{bundle.noRecordsFound}" paginator="true"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="20,50,100" rows="20" paginatorPosition="bottom" resizableColumns="true" resortMode="single"
draggableColumns="true" selection="#{patientsBean.selectedPatients}" rowKey="#{patientData.ID}"
paginatorAlwaysVisible="false" sortBy="#{patientsBean.sortField}">

    <p:ajax event="sort" listener="#{patientsBean.onSort}"/>
    <p:ajax event="rowSelect" listener="#{patientsBean.onRowSelect}" />
    <p:ajax event="colReorder" listener="#{patientsBean.onReorder}" />
    <p:ajax event="rowSelectCheckbox" update="@form" />
    <p:ajax event="rowUnselectCheckbox" update="@form" />
    <p:ajax event="toggleSelect" update="@form" />

    <p:column selectionMode="multiple" style="width:16px;text-align:center" selectRow="false" resizable="false"
      visible="#{patientsBean.multiSelectionEnabled}" />

    <p:columns id="patientColumns" var="columnIndex" value="#{patientsBean.columnIndices}"
      sortBy="#{patientData.getColumnValue(columnIndex).sortValue}">
      <ui:param name="column" value="#{patientData.getColumnValue(columnIndex)}" />

      <f:facet name="header">
        <h:outputText value="#{patientsBean.getColumnName(columnIndex)}" />
      </f:facet>

      <p:column rendered="#{column.displayType == 'TEXT' or column.displayType == 'LINK'}">
        <h:outputText value="#{column.value}" />
      </p:column>
    </p:columns>
 </p:dataTable>

bean Code: 
public void onSort(SortEvent event) {
    onSort(event, MY_P);
}

as soon as I add the ajax event, sorting doesn't work anymore. Nothing happens and listener i not called.
Without ajax sorting works fine.
Any solution proposals? Would be great :)
I need to save the sorting, so I really need the ajax listener.

A:

I got it solved by changing the onSort(SortEvent event) to onSort(AjaxBehaviourEvent event) in the backend.
You can cast it to SortEvent later on..
Sad that it's explained different on showCases

