Sheet column update value problem.

Community Driven Extensions Project
Post Reply
arcavus
Posts: 1
Joined: 22 Jan 2020, 14:05

22 Jan 2020, 14:25

Hello,
I am a newbie prime extension. I am using a 7.0.2 prime extension library.
My problem is that when select item column change does not affect other column values. I struggle to do this job with ajax change event. My backing bean process value and set row values nicely. But I always see old column values. Briefly, my column does not update correctly.
ajax xhtml is that
<p:ajax event="change" listener="#{extreDefinitionAndOperationsBean.cellChangeEvent}" oncomplete="PF('sheetWidget').redraw()"
update="extreDefinitionForm"/>
Do you think what's the problem.

Code: Select all

 <pe:sheet id="sheet" value="#{extreDefinitionAndOperationsBean.sheetRows}" var="row" height="400"
                      rowKey="#{row.extreDefinition.uuid}"
                      showRowHeaders="true" sortOrder="ascending" width="800"
                      rendered="#{extreDefinitionAndOperationsBean.sheetRows.size()>0}"
                      widgetVar="sheetWidget" filteredValue="#{extreDefinitionAndOperationsBean.filteredSheetRows}"
                      extender="sheetExtender">
                <p:ajax event="change" listener="#{extreDefinitionAndOperationsBean.cellChangeEvent}" oncomplete="PF('sheetWidget').redraw()"
                        update="extreDefinitionForm"/>
                <f:facet name="header">
                    <h:outputText value="#{label['page.extre.definition.extre.details']}"/>
                </f:facet>
                <pe:sheetcolumn headerText="#{label['page.extre.treaty.year']}" value="#{row.treatyYear}" colWidth="30"/>
                <pe:sheetcolumn headerText="#{label['page.agreement.agreementNumber']}"
                                value="#{row.agreementNo}"
                                sortBy="#{row.agreementNo}"
                                colWidth="30"/>
                <pe:sheetcolumn headerText="#{label['page.facultativeAgreement.branches']}" value="#{row.branchName}"
                                colWidth="40" valueChangeListener="#{extreDefinitionAndOperationsBean.branchChange(row)}"
                                sortBy="#{row.branchName}"
                                colType="dropdown"
                                selectItems="#{extreDefinitionAndOperationsBean.branches}">
                </pe:sheetcolumn>
                <pe:sheetcolumn id="branchCode" headerText="#{label['page.extre.branch.code']}" value="#{row.branchCode}" immediate="true"
                                colWidth="30" readOnly="true"/>
                <pe:sheetcolumn headerText="#{label['page.extre.coverage']}" value="#{row.coverageName}"
                                colWidth="40" valueChangeListener="#{extreDefinitionAndOperationsBean.coveregaChange(row)}"
                                sortBy="#{row.coverageName}"
                                colType="dropdown"
                                selectItems="#{extreDefinitionAndOperationsBean.coverages}">
                </pe:sheetcolumn>
                <pe:sheetcolumn id="coverageCode" headerText="#{label['page.extre.coverage.code']}" value="#{row.coverageCode}"
                                colWidth="30" readOnly="true" />
                <pe:sheetcolumn id="pnlCode" headerText="#{label['page.extre.coverage.pnlCode']}" value="#{row.pnlCode}"
                                colWidth="30" readOnly="true" />

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

23 Jan 2020, 14:23

That is not the way the sheet is designed. The sheet only submits the single cell you edited to the backend and only updates that cell for validation..

If you want to update some other cell you will most likely have to use javaScript to update the other cell.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

clementine
Posts: 11
Joined: 05 Nov 2019, 20:39

05 Feb 2020, 01:14

I'm facing the same issue. Any tips for getting the ID of a particular cell? Maybe another cell in the same row as the one being updated? Thanks.

Melloware
Posts: 3716
Joined: 22 Apr 2013, 15:48

05 Feb 2020, 14:26

To get at the core HandsonTable you can do...

Code: Select all

PF('mySheet').ht
Then look at the HandsonTable docs you can do an unlimited amount of things like navigating cells, finding cells, changing cell values etc. The whole power of HandsonTable is at your disposal.

For example here is the getDataAtCell() method: https://handsontable.com/docs/7.3.0/Cor ... DataAtCell
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests