Help with column sort when p:dataTable "reflow=true"

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
lelloimoveis
Posts: 6
Joined: 23 Mar 2017, 17:45

31 Mar 2017, 14:34

Hello,

I would like to change the select label created when p:dataTable is reflow=true. Example:

Code: Select all

                        <p:dataTable var="car" value="#{seusImoveisMB.lista}" selectionMode="single"  reflow="true" rowKey="#{car.imovel}" paginator="true" rows="10" >
                            <f:facet name="header">
                                Selecione o imóvel para mais informações
                            </f:facet>
                            <p:column headerText="Imóvel" sortBy="#{car.imovel}" style="width:50%;min-width:50%;min-width:100%;white-space: nowrap;" ariaHeaderText="Imóvel" >
                                <h:outputText value="#{car.imovel}" />
                            </p:column>

                            <p:column headerText="Vistorias" sortBy="#{car.vistoria}"  style="min-width:15%;">
                                <h:outputText value="#{car.vistoria}" />
                            </p:column>
                        </p:dataTable>

When open in mobile this generates

Code: Select all

<select  class="ui-reflow-dropdown ui-state-default">
	<option value="0_0">Imóvel Ascending</option>
	<option value="0_1">Imóvel Descending</option>
	<option value="1_0">Vistorias Ascending</option>
	<option value="1_1">Vistorias Descending</option>
</select>
How can I change the label "Ascending" and "Descending" ?

Thank you

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

03 Apr 2017, 09:47

Firstly, It is not a Layout or Theme issue. Next time, please use PrimeFaces core forum; viewforum.php?f=3

For this issue, you need to change the value of primefaces.datatable.SORT_ASC and primefaces.datatable.SORT_DESC keys on messages.properties. (You can create custom messages.properties)
Default values;

Code: Select all

primefaces.datatable.SORT_ASC = Ascending
primefaces.datatable.SORT_DESC = Descending

lelloimoveis
Posts: 6
Joined: 23 Mar 2017, 17:45

03 Apr 2017, 15:44

Hello aragorn,

I created messages.properties file and it worked.

Thank you,

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

05 Apr 2017, 11:27

Glad to hear, thanks for the update!

marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

18 Apr 2017, 14:40

Hi,

Can you post your configuration? Faces-config.xml file? My configuration does not work !!

Thks!

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

18 Apr 2017, 15:26

Please create custom messages.properties file and add the following code in it;

primefaces.datatable.SORT_ASC = TEST Ascending
primefaces.datatable.SORT_DESC = TEST Descending

Please examine; http://stackoverflow.com/questions/2772 ... r-messages
https://www.mkyong.com/jsf2/jsf-2-0-and ... s-example/

marcelocaser
Posts: 122
Joined: 13 Dec 2011, 15:07

18 Apr 2017, 17:10

Hi!
Thank you! It worked!!

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

20 Apr 2017, 08:30

Glad to hear, thanks for the update!

Post Reply

Return to “Poseidon - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests