Bonjour.
Voilà une bonne journée que je me prends la tête.

Je voudrais réaliser un truc tout con : réaliser un appel serveur pour récupérer des données et les mettre dans une combobox comme valeurs.

Voilà où j'en suis : l'appel à mon Action struts se réalise bien, un xml m'est renvoyé ... mais je ne vois rien apparaître dans ma combo.

Partie présentation :
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
 
var urlPatternList = './getPatternList.aspx';
 
        // 1. instanciation de la combobox de patterns
        var lignePatternFields = [
                'id',
                'name',
                'tName',
                'addMode',
                'purge',
                'patternFormatList'
            ];
 
        var patternStore = new  Ext.data.XmlStore({
            proxy: new Ext.data.HttpProxy({ url: urlPatternList }),
              remoteSort: false,
              autoSave: false,
              autoLoad: false,
              fields: [
                     'id',
                    'name',
                    'tName',
                    'addMode',
                    'purge',
                    'patternFormatList'
                ],
              record: 'pattern',
            restfull: true
        });
 
        var patternList = new Ext.form.ComboBox({  
             fieldLabel: 'pattern à employer',  
             store: patternStore,
             valueField: 'id',
             displayField: 'name',  
             hiddenName: 'id',
             mode: 'remote',
             minChars : 0  
         }); 
 
        // 2. création du panel de saisie
        var centerPanel = new Ext.form.FormPanel( {
            frame:true,
            height:300,
            region : "center",
            title:'Saisie de nouveaux formats',
            labelWidth : 200,
            defaultType : 'textfield',
            items : [ {
                  xtype : "textfield",
                  fieldLabel : '<bean:message key="format.nom"/>',
                  id : "user"
              }, 
              patternList,
              {
                xtype: 'fileuploadfield',
                id: 'file',
                emptyText: 'Choisissez un fichier',
                name: 'file',
                hideLabel:true,
                width:450,
                allowBlank:false,
                blankText:'Veuillez choisir un fichier',
                buttonCfg: {
                    text: '',
                    iconCls: 'upload-icon'
                }
            }],
            bodyBorder:true
            //buttonAlign:'center',
            //buttons: [{
            //    text: 'Valider',
            //    handler:function(){
            //        upload(principalPanel,window);
            //        
            //    }
            //}]
        });
 
 
        // 3. création du panel principal
        var principalPanel = new Ext.Panel({
            layout:'border',
            items:[centerPanel],
            id: 'formatsPanel',
            html: '<div id="pageCenterDiv"></div>'
        });
l'url appelée répond et me renvoie le xml suivant (généré via JAXB) :
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
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ns7:patternList xmlns:ns2="http://www.example.org/patternFormat" 
            xmlns:ns4="http://www.example.org/PatternFormatList" 
            xmlns:ns3="http://www.example.org/format" 
            xmlns:ns5="http://www.example.org/formatList" 
            xmlns:ns6="http://www.example.org/pattern" 
            xmlns:ns7="http://www.example.org/PatternList">
 
        <ns7:pattern>
            <ns6:id>1</ns6:id>
            <ns6:name>Reparto_nonal</ns6:name>
            <ns6:tName>Reparto</ns6:tName>
            <ns6:addMode>H</ns6:addMode>
            <ns6:purge>0</ns6:purge>
        </ns7:pattern>
    </ns7:patternList>
Si quelqu'un a une idée, je suis preneur, car j'ai parcouru pas mal de discussions, j'ai essayé beaucoup de choses, mais je ne suis arrivé à rien ... Après j'ai peut être raté une vache dans un couloir