SubTable commandLink issues in header

UI Components for JSF
Post Reply
hipdragon
Posts: 34
Joined: 23 Sep 2010, 02:47

26 Apr 2017, 18:57

I think i found a bug or issue with SubTables. Below is some example code for it. Basically the issue is the commandLink will not hit the backing bean inside of the facet header of the subTable. Moving the commandLinks around show they work just fine. But if I put them inside the subTable header it doesn't call the backing bean.

Code: Select all

<p:dataTable id="table"
                             paginator="true"
                             paginatorAlwaysVisible="false"
                             rows="10"
                             var="day"
                             value="#{pageBean.schedule}">
                <f:facet name="header">
                    Schedule
                </f:facet>

                <p:columnGroup type="header">
                    <p:row>
                        <p:column headerText="Start Time" />
                        <p:column headerText="End Time" />
                    </p:row>
                </p:columnGroup>

                <p:subTable id="workSubTable" var="work" value="#{day.work}">
                    <f:facet name="header">
                        <h:outputText value="#{day.name} " />
                        <p:commandLink value="Remove" update="table" actionListener="#{pageBean.removeDay()}">
                            <f:setPropertyActionListener target="#{pageBean.dayName}" value="#{day.name}" />
                        </p:commandLink>
                        <p:commandLink value="test" actionListener="#{pageBean.removeDay()}" />
                        <p:commandLink value="test2" action="#{pageBean.removeDay()}" />
                        <p:commandLink value="test3" actionListener="#{pageBean.removeDay(day)}" />
                    </f:facet>

                    <p:column>
                        <h:outputText value="#{work.start}" />
                    </p:column>

                    <p:column>
                        <h:outputText value="#{work.end}" />

                    </p:column>
                </p:subTable>
            </p:dataTable>
        </h:form>
Thanks for any help.

hipdragon
Posts: 34
Joined: 23 Sep 2010, 02:47

26 Apr 2017, 19:27

More information, i added a commandLink inside of a column under the subTable. That commandLink works, after clicking that commandLink the header commandLinks start to work as well. But won't work until you click on a commandLink inside of the table.

Edit:

The header commandLink appears to only work when the subtable has no rows in any of it's groupings.

Thanks.

andynguyen
Posts: 3
Joined: 13 Oct 2016, 04:09

27 Sep 2017, 07:00

Did you find a solution to your problem? I have similar issue; I'm running Primefaces 6.1.5.

andynguyen
Posts: 3
Joined: 13 Oct 2016, 04:09

27 Sep 2017, 08:33

Furthermore, I found this on Stackoverflow https://stackoverflow.com/questions/178 ... pcolumngr/ which describe the same problem. The reply marked as answer mentioned it is fixed for Elite version, but I found it is not since I am using Elite version 6.1.5.

hipdragon
Posts: 34
Joined: 23 Sep 2010, 02:47

27 Sep 2017, 16:34

The Stackoverflow link i don't believe is actually the same issue. But i still have had this issue even with the latest PrimeFaces 6.1.x releases. I had to remodel the data and display to work around this issue. It's not as nice as what i was hoping for but i couldn't figure out the solution without going into the PrimeFaces source. I just didn't have time to dig into the PrimeFaces source code to figure out the problem and possible solutions.

andynguyen
Posts: 3
Joined: 13 Oct 2016, 04:09

27 Sep 2017, 18:22

arggr I see. I myself struggled and gave up with this almost a year ago. Since I recently purchased Elite subscription, I give it another try.
In my opinion the two problems share similarity in a way that we all try to use f:setPropertyActionListener in a p:commandButton (or commandLink) from a header/footer of subtable. And this doesn't work.

SebastianG
Posts: 4
Joined: 01 Jun 2018, 11:03

31 Jan 2019, 13:20

Same problem here.
Any solution for this?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

31 Jan 2019, 14:00

If you use the same old version, a newer version might solve it

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests