roweditor

p:dataTable rowEdit doesn't update row object [duplicate]

…衆ロ難τιáo~ 提交于 2020-01-06 19:51:33
问题 This question already has an answer here : How and when should I load the model from database for h:dataTable (1 answer) Closed 4 years ago . I'm trying to edit rows on datatable using rowEdit mode but it doesn't work for me. Here is the rowEdit event : <p:ajax event="rowEdit" listener="#{saisirHeuresForm.updateMyRow}" update=":saisirHeuresForm:messages"/> And the managedBean corresponding method : public void updateMyRow(RowEditEvent event) { event.getObject(); } The event.getObject() method

Bean method on rowEdit event of p:dataTable is not invoked

心已入冬 提交于 2019-12-25 06:57:43
问题 I am trying edit row from <p:dataTable> n call bean method but the problem is bean method is not invoked on rowEdit event. It will be appreciable, if someone could give me the solution. Also, my bean is already in View Scope, even not working in session scope... I have tried for all three scopes. My codes are given below : <h:form id="commentList"> <p:dataTable id="commentTable" editable="true" paginator="true" rows="10" var="comment" value="#{commentAction.list(uID)}" class="table table

Edited/updated values in p:dataTable rowEdit are not available in listener method as they are being overwritten by existing data from database

瘦欲@ 提交于 2019-12-20 02:41:16
问题 I'm editing data with <p:dataTable> row editor as below. <p:dataTable value="#{bean.users}" var="user" editable="true"> <p:ajax event="rowEdit" listener="#{bean.onRowEdit}" /> <p:ajax event="rowEditCancel" listener="#{bean.onRowEditCancel}" /> <p:column> <p:cellEditor> <f:facet name="output"> <h:outputText value="#{user.firstName}" /> </f:facet> <f:facet name="input"> <p:inputText value="#{user.firstName}" /> </f:facet> </p:cellEditor> </p:column> </p:dataTable> The backing bean is

Show a confirm message before <p:rowEditor> updates the model on click of “OK” button

谁都会走 提交于 2019-12-12 18:24:02
问题 I'm using <p:rowEditor> as follows: <p:column headerText="Libellé"> <p:cellEditor> <f:facet name="output"> <h:outputText value="#{lot.libelle}" /> </f:facet> <f:facet name="input"> <p:inputText value="#{lot.libelle}" /> </f:facet> </p:cellEditor> </p:column> <p:column> <p:rowEditor /> </p:column> I would like to show a confirm message before the <p:rowEditor> updates the model on click of the "OK" button. How can I achieve this? 回答1: You can use onstart attribute of <p:ajax event="rowEdit">

edit only specific fields in gridview using edit template

青春壹個敷衍的年華 提交于 2019-12-12 03:44:56
问题 i am having an error : Object reference not set to an instance of an object. and the red text is: dt.Rows[row.RowIndex]["Name"] = Name; i want to edit data in my gridview. here is my code: protected void OnUpdate(object sender, EventArgs e) { GridViewRow row = (sender as LinkButton).NamingContainer as GridViewRow; string Name = (row.Cells[0].Controls[0] as TextBox).Text; string Price = (row.Cells[2].Controls[0] as TextBox).Text; DataTable dt = ViewState["dt"] as DataTable; dt.Rows[row

Edited/updated values in p:dataTable rowEdit are not available in listener method as they are being overwritten by existing data from database

谁说我不能喝 提交于 2019-12-01 21:39:58
I'm editing data with <p:dataTable> row editor as below. <p:dataTable value="#{bean.users}" var="user" editable="true"> <p:ajax event="rowEdit" listener="#{bean.onRowEdit}" /> <p:ajax event="rowEditCancel" listener="#{bean.onRowEditCancel}" /> <p:column> <p:cellEditor> <f:facet name="output"> <h:outputText value="#{user.firstName}" /> </f:facet> <f:facet name="input"> <p:inputText value="#{user.firstName}" /> </f:facet> </p:cellEditor> </p:column> </p:dataTable> The backing bean is implemented as below. private List<User> users; @EJB private UserService userService; public List<User> getUsers(