简体   繁体   中英

primefaces p:ajax event=“cellEdit” not firing

I have datatable with celledit, the ajax event does not fire on cell edit. The event listener does not get called.Thanks.

<ui:define name="content">
    <h:form prependId="false" id="tForm">
        <p:datatable id="dTable" value="#{bean.tData}" var="data"
            editable="true" editMode="cell">
            <p:ajax event="cellEdit" listener="#{bean.updateData(data)}" />
            <p:column>
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{data.name}"></h:outputText>
                    </f:facet>
                    <f:facet name="input">
                        <p:inputText value="#{data.name}"></p:inputText>
                    </f:facet>
                </p:cellEditor>
            </p:column>
        </p:datatable>
    </h:form>
</ui:define>

bean listener method

public void updateData(Data d){
    logger.debug(d.getName());
}

I think you should use this instead:

  <p:ajax event="cellEdit" listener="#{bean.updateData}" />

    public void updateData(CellEditEvent event) {   
    Object newValue = event.getNewValue();  
    logger.debug(newValue.toString());
    } 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM