Datatable sort problem

UI Components for JSF
Post Reply
Robelind
Posts: 15
Joined: 01 Dec 2009, 09:11

01 Dec 2009, 09:40

I have a problem sorting on a datatable column, when the content of the column is a h:commandLink.

h:commandLink:
Image

As opposed to using h:outputText:
Image

What can I do to fix this?
Using 1.0.0.RC.

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

01 Dec 2009, 10:39

Hi,

can you post your code so that we can see how it can be fixed?

Thanks,

Yigit.

Inah
Posts: 31
Joined: 18 Nov 2009, 00:01
Location: Brazil

01 Dec 2009, 13:28

Hi!!
I'm havng the same problem!
I tried with p:commandLink too, but when I put dynamic="true" in my dataTable it stops work at all....

Code: Select all

<h:form id="campaignTable">
						<p:dataTable rows="5" value="#{campaignBean.campaigns}" paginator="true" var="campaign" selection="#{campaignBean.selectedIds}" widgetVar="campaign" emptyMessage="Nao ha registros"
							scrollable="true" width="100%" height="250px"
							paginatorTemplate="{FirstPageLink}{PreviousPageLink}{PageLinks}{NextPageLink}{LastPageLink}"
							rowsPerPageTemplate="50,100,200">
							
							<p:column>
								<f:facet name="header">
									<h:outputText value="#{cpg.sinc}" />
								</f:facet>
								<h:graphicImage value="/bidmanagement/images/apply.gif"
									rendered="#{campaign.tries == -1}" />
								<h:graphicImage value="/bidmanagement/images/sync.gif"
									rendered="#{campaign.tries == 0}" />
								<h:graphicImage value="/bidmanagement/images/alert1.gif"
									rendered="#{campaign.tries == 1}" />
								<h:graphicImage value="/bidmanagement/images/alert2.gif"
									rendered="#{campaign.tries == 2}" />
								<h:graphicImage value="/bidmanagement/images/alert3.gif"
									rendered="#{campaign.tries == 3}" />
							</p:column>
							<p:column sortBy="#{campaign.campaign}">
								<f:facet name="header">
									<h:outputText value="#{cpg.campaign}" />
								</f:facet>
								<h:commandLink rel="loading" id="commandCampaign"
									action="#{campaignBean.listAdGroups}" value="#{campaign.name}">
									<f:param name="campaignID" value="#{campaign.id}" />
								</h:commandLink>
							</p:column>
I'm using a loadbuncle to internationalize my app, so var cpg is the same of campaign.....
I tried to put sortBy="#{campaign.campaign}" and sortBy="#{cpg.campaign}"
I took out the h:commandLink of the column and worked just fine.....

Could u help me, please?

TKS!
Inah from Brazil

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

03 Dec 2009, 16:49

Which sorting method do you guys use? client or ajax? dynamic="true|false" attribute controls that behavior. If it is client sorting, can you try with ajax sorting to see how it works?

Robelind
Posts: 15
Joined: 01 Dec 2009, 09:11

03 Dec 2009, 17:16

I'm using client side sorting. Will see if I can find the time to try Ajax sorting.
There's also a (probably) related problem. You can't use parser="number" when
the column content is h:commandLink, to avoid this problem:
Image

If you use parser="number", the column becomes empty, i.e. no values displayed at all.

Inah
Posts: 31
Joined: 18 Nov 2009, 00:01
Location: Brazil

03 Dec 2009, 20:47

Hi!
I'm using client side too. If I try the ajax(putting dynamic="true") the dataTable stops working...stay " Loading" 4ever....
Inah from Brazil


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests