Bonjour,

J'ai remarqué qu'une fonctionnalitée de Richfaces ne marche pas de la même manière d'un serveur à un autre. Dans mon exemple, j'affiche une liste "d'utilisateur" dans un extendedDataTable. Sur le serveur Weblogic et sur le serveur Tomcat, lorsque je fais un order by du plus grand au plus petit sur la colonne age, tout s'affiche normalement. Par contre si je créé une list à 2 entrées et que je l'affiche via la balise columns, l'order by de la colonne age ne fait plus correctement sur le serveur Weblogic. Ca va me mettre l'age dans cette ordre : 9, 8, 7, 6, 5, 4, 3, 2, 11, 10, 1. Par contre avec Tomcat ça marche bien, les chiffres sont dans le bon ordre.

Les projets Tomcat et Weblogic sont identiques, ils ont les mêmes librairies (sauf les librairies serveurs), les mêmes sources, les mêmes pages, et les mêmes configurations au niveau du faces-config et du web.xml

Voici la source de mon mananed bean :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;
import org.ajax4jsf.component.html.HtmlAjaxSupport;
 
/**
 *
 * @author Erouan
 */
public class Bean implements Serializable, ActionListener {
 
    private List<Utilisateur> list;
    private List<List<Object>> list2;
    private List<Column> columns;
    private boolean deleteCheckboxValue;
    private String value;
 
    public Bean() {
        System.out.println("coucocucoucocu");
        list = new ArrayList<Utilisateur>();
        list.add(new Utilisateur("antoine", "rouaze", "2 cite Auby", 1));
        list.add(new Utilisateur("théo", "ferric", "2 cite Auby", 2));
        list.add(new Utilisateur("hugo", "ferric", "2 cite Auby", 3));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 4));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 5));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 6));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 7));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 8));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 9));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 10));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 11));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 12));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 13));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 14));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 15));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 16));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 17));
        list.add(new Utilisateur("tom", "ferric", "2 cite Auby", 18));
 
        columns = new ArrayList<Column>();
        columns.add(new Column(""));
        columns.add(new Column("Prenom"));
        columns.add(new Column("nom"));
        columns.add(new Column("ardesse"));
        columns.add(new Column("age"));
 
        list2 = new ArrayList<List<Object>>();
        List<Object> array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(1);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(2);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(3);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(4);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(5);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(6);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(7);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(8);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(9);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(10);
        list2.add(array);
        array = new ArrayList<Object>();
        array.add(false);
        array.add("antoine");
        array.add("rouaze");
        array.add("2 cité Auby");
        array.add(11);
        list2.add(array);
 
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).getAge().getClass().getName());
        }
    }
 
 
 
    public List<Utilisateur> getList() {
        return list;
    }
 
    public void setList(List<Utilisateur> list) {
        this.list = list;
    }
 
    public List<Column> getColumns() {
        return columns;
    }
 
    public void setColumns(List<Column> columns) {
        this.columns = columns;
    }
 
    public List<List<Object>> getList2() {
        return list2;
    }
 
    public void setList2(List<List<Object>> list2) {
        this.list2 = list2;
    }
 
    public String getValue() {
        return value;
    }
 
    public void setValue(String value) {
        this.value = value;
    }
 
    public void processAction(ActionEvent event) throws AbortProcessingException {
        System.out.println("Bean => " + ((HtmlAjaxSupport)event.getComponent()).getData());
    }
 
    public boolean isDeleteCheckboxValue() {
        return deleteCheckboxValue;
    }
 
    public void setDeleteCheckboxValue(boolean deleteCheckboxValue) {
        this.deleteCheckboxValue = deleteCheckboxValue;
    }
 
 
}
Et ma page .xhtml :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j">
    <head>
        <title>Facelet Title</title>
    </head>
    <body>
        <h:form>
            <rich:extendedDataTable id="table" value="#{bean.list}" var="list">
                <rich:column sortBy="#{list.prenom}" id="col_1" label="Prenom">
                    <f:facet name="header">
                        <h:outputText id="prenom" value="Prenom"/>
                    </f:facet>
                    <h:outputText id="prenom_name" value="#{list.prenom}"/>
                </rich:column>
                <rich:column sortBy="#{list.nom}" id="col_2" label="Nom">
                    <f:facet name="header">
                        <h:outputText id="nom" value="Nom"/>
                    </f:facet>
                    <h:outputText id="nom_name" value="#{list.nom}"/>
                </rich:column>
                <rich:column sortBy="#{list.adresse}" id="col_3" label="Adresse">
                    <f:facet name="header">
                        <h:outputText id="adresse" value="Adresse"/>
                    </f:facet>
                    <h:outputText id="adresse_name" value="#{list.adresse}"/>
                </rich:column>
                <rich:column sortBy="#{list.age}" id="col4" label="Age">
                    <f:facet name="header">
                        <h:outputText id="age" value="Age"/>
                    </f:facet>
                    <h:outputText id="age_name" value="#{list.age}"/>
                </rich:column>
            </rich:extendedDataTable>
            <rich:extendedDataTable id="table2" value="#{bean.list2}" var="list3" >
                <rich:columns index="i" value="#{bean.columns}" selfSorted="false" var="listheader" sortBy="#{list3[i]}" sortOrder="#{listheader.sortOrder}">
                    <f:facet name="header">
                        <h:panelGroup>
                            <h:selectBooleanCheckbox rendered="#{i==0}" value="#{bean.deleteCheckboxValue}"/>
                            <h:outputText rendered="#{i!=0}" value="#{listheader.header}"/>
                        </h:panelGroup>
                    </f:facet>
                    <rich:inplaceInput rendered="#{i!=0}" value="#{list3[i]}">
                        <a4j:support actionListener="#{bean.processAction}" data="data:#{list3[i]}" event="onviewactivated"/>
                    </rich:inplaceInput>
                    <h:selectBooleanCheckbox value="#{list3[i]}" rendered="#{i==0}"/>
                </rich:columns>
            </rich:extendedDataTable>
            <a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"/>
        </h:form>
    </body>
</html>
Je sais ça pique les yeux, tout est static, c'est moche . Mais c'est juste un test. Et vous allez me dire pourquoi utiliser la balise columns et non utiliser une liste d'objets ? C'est juste que dans mon projet je doit afficher le contenu d'une table sans connaitre les noms et le nombre de colonnes que possède la table.

Voila je ne vois pas du tout pourquoi il a cette différence, qui est plutôt bizarre. Est-ce que ça vous est déjà arrivé ?

Merci d'avance,