在数据表中的单元格编辑,用于未将编辑值发送到事件的主要面

时间:2012-05-09 07:25:22

标签: datatable primefaces inline inline-editing

我想要一个在datatable中具有内联编辑选项的表。我能够编写完整的代码但是当我点击编辑按钮时,我从服务器端的事件对象获取的值与旧的相同。我没有获得新的价值观。

如何从事件对象中获取新值。

<p:dataTable id="dataTable" 
                var="osList" 
                 value="#{WLMPortalViewController.allOSInfo}" rowKey="#{osList.osName}" 
                          paginator="true" rows="5"
                            paginatorPosition="bottom"
                           editable="true" >
                    <p:ajax event="rowEdit" update="@this" listener="#{WLMPortalDataController.saveOSData}"/>
                <p:column headerText="Options" >
                    <p:rowEditor  /> 
                </p:column>


             <p:column headerText="Version" >
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{osList.osVersion}" />
                    </f:facet>
                    <f:facet name="input">
                        <p:inputText id="inputosVer" required="true" requiredMessage="* Version can't Empty." value="#{osList.osVersion}" />
                    </f:facet>
                </p:cellEditor>
             </p:column> 

            </p:dataTable>

我的服务器端代码看起来像这样

public void saveOSData(RowEditEvent event){

    System.out.print(event.getObject());

}

0 个答案:

没有答案