<p:summaryRow> position top?

UI Components for JSF
gfcarvalho
Posts: 12
Joined: 25 May 2010, 14:14

04 Nov 2011, 13:43

Is it possible set position of the <p:summaryRow> component at the top of the row?
I need to put the summaryRow on the top of the row(record). It would be something <p:summaryRow position="top">

Code: Select all

<p:dataTable value="#{bean.list}" var="row">
   <p:summaryRow>
      <p:column />
  </p:summaryRow>			
  <p:column>
    <p:graphicImage value="/img/avatar.jpeg" width="50" height="50" cache="false" />
  </p:column>
 </p:dataTable>
I'm using 3.0 M4
Thanks.
[]'s Guilherme

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

20 Dec 2013, 20:26

Is it possible?
Primefaces 12.0, WildFly 21

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

20 Dec 2013, 20:42

Not without big changes to the component. What you could try is to move them with jquery after the datatable is displayed.

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

20 Dec 2013, 21:01

are there other options?
Primefaces 12.0, WildFly 21

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

21 Dec 2013, 02:30

- Downloading the source of the component and changing it there
- using summaryrows at the bottom
- don't use summary rows
- ...

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

21 Dec 2013, 06:46

I won't prefer to use summaryRow when the datatable need to be updated for operations like search,filtering etc.Because summaryRow won't be updated along with datatable.But anyway you can use remoteCommand to update the summaryRow.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

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

21 Dec 2013, 13:32

sudheer wrote:I won't prefer to use summaryRow when the datatable need to be updated for operations like search,filtering etc.Because summaryRow won't be updated along with datatable
That is imo a 'bug' since it is not mentioned anywhere which features of a atatable are supposed to be working when combined and which are not. But I'm also aware that such an overview is difficult to put together.

rider
Posts: 497
Joined: 05 Mar 2010, 13:17

21 Dec 2013, 14:51

could you implement this in PF 5.0, please?

I think this feature will use other people. Here is an example:

ID NAME SURNAME
------- GROUPNAME1 ----
1 Mark Name
2 Sarah Name
3 Michael Name
------- GROUPNAME2 ----
4 John Name
5 Patrick Name
Primefaces 12.0, WildFly 21

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

21 Dec 2013, 16:57

I just had a quick look, and you can override this fuctionality by copying the source of DataTableRenderer.java into your own project and change the implementation of the encodeRows method. You'll see there that the summaryRow is 'encoded' when a switch is made from one groep to another. Moving that to the front and slightly adapting the check in the 'isInSameGroup' method might work. If you want to make it configurable it is more work. It becomes kind of like 'grouping' the subtable feature does. Did you have a look at that?

smokeybandit
Posts: 277
Joined: 08 Jul 2013, 17:53

28 Sep 2015, 14:00

I know this is an old topic, but I had the same requirement and with the above advice, was able to get it to work. I added an attribute to the summaryRow class, then added a second isInSameGroup function for when summaryRow.location = "top". It was a bit challenging since once I got the summary row on top, it messed up the data rows, but that was due to me not really understanding how table.setRowIndex worked.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests