inplace save event not fired

UI Components for JSF
Post Reply
kgoedert
Posts: 22
Joined: 22 Jul 2009, 18:42

07 Oct 2011, 19:09

Hi,

I'm trying to make an editable row inside a <p:datatable> like shown in the showcase. I'm using primefaces 3.0M3 and jboss 6.0.0. But the rowEdit event doesnt get fired. Then I also tried to place the inplace element inside the datatable and fire the save event. Like this

Code: Select all

<f:facet id="nameFct" name="header">#{label['menu.admin.environment']}</f:facet>
						<p:inplace editor="true" effectSpeed="fast" event="dblclick">
							<p:inputText value="#{amb.dsAmbiente}"/>
							<p:ajax event="save" listener="#{environment.update(amb)}" />
						</p:inplace>
The save event also didnt get fired. Can somebody help?

Thanks

Kelly

IanF
Posts: 22
Joined: 22 Mar 2010, 21:33

13 Oct 2011, 21:20

I believe you should use a combination of p:rowEditor and p:cellEditor when inside a dataTable. That's how I got it to work. I think that the p:inplace is meant for outside a dataTable. Here's an example:

Code: Select all

                        <p:dataTable id="editDataTable"
                                     value="#{editTable.databaseTableData.records}" 
                                     var="record"
                                     styleClass="autoTableLayout centerTable" 
                                     paginator="#{editTable.databaseTableData.recordsSize gt 50}"
                                     rows="50"
                                     paginatorTemplate="Page{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}rows per page"
                                     rowsPerPageTemplate="25,50,75,100"
                                     widgetVar="widget_editDataTable" > 
                            <p:ajax event="rowEdit" 
                                    listener="#{editTable.rowEditListener}" />

                            <p:column headerText="Options" >
                                <p:rowEditor id="rowEditControl"
                                             rendered="#{editTable.selectedDatabaseTable.canBeUpdated}" />
                                <p:cellEditor>
                                    <f:facet name="output">
                                        ... things here show when user has not clicked on the RowEdit icon (pencil)
                                    </f:facet>
                                    <f:facet name="input">
                                        ... things here show when user HAS clicked on the RowEdit icon (pencil)
                                    </f:facet>
                                </p:cellEditor>
                            </p:column>
                        </p:dataTable>
Thanks,

(Weblogic 12.1.2.0.0
Mojarra 2.1.28,
PrimeFaces 4.0.12,
NetBeans 8)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests