Combobox not show the correct language values in struts1
Asked Answered
C

1

6

Im using ExtJS and Struts1 for an application, when user uses this app in english and displays the combobox (inside form), the selection is in another language (spanish) but not in english. After save the form and reload the page this parameter shows in english (but if user displays the combobox again it shows in spanish). What im doing wrong to show the combobox in the correct language?.

This is what happens:

The code has more than 4k lines, this is the combobox creation, if you need more lines i dont have any problem to put here.

        var storeTipoProcedimiento = new Ext.data.SimpleStore({
            proxy: dameProxy( 'gestionPlanes.do' ),
            autoLoad: true,
            fields: [
               {name: 'idTipoProcedimiento', type: 'int'},
               {name: 'descripcion'}
            ],
            baseParams: {
                method: 'buscarTipoProcedimiento'
            }
        });

        //combo para buscar los tipos de procedimientos
        function dameComboTipoProcedimiento(){
            var combo = new Ext.form.ComboBox({
                 store: storeTipoProcedimiento
                 ,valueField: 'idTipoProcedimiento'                  
                 ,fieldLabel:'<bean:message key="label.gd.tab2.tipoProc"/>'
                 ,displayField:'descripcion'
                 ,labelStyle: 'color: red; width: 114px;'
                 ,fieldClass: 'padding-left: 50px;'                  
                 ,mode:'local'
                 ,triggerAction:'all'
                 ,editable: false                
                 ,name: 'Select_Tipo'
                 ,id: 'Select_Tipo'
                 ,hiddenName: 'idTipo'
                 ,width: 190
                 ,emptyText: '<bean:message key="label.gd.tab2.tipoProc.msgElijaTipo"/>'
                 ,listeners: {
                    'collapse': function(){
                        tipoProcedimientoId = this.value;
                    },
                    select:{fn:function(combo){
                        tipoProcedimientoId = combo.getValue();
                    }}
                 }
            });
            return combo;
        }   
Cady answered 21/5, 2015 at 9:7 Comment(2)
Without additional code is impossible to guess.Hackman
ExtJS version and how are you working with Localization?Circumsolar
P
0

Check the response from server. Probably the request you are doing for loading combobox is probably returning Spanish data than english data. May be server is able to recognize the first request as right localization but for the next hit it is failing to detect. Share the code for store and proxy settings. May be we can judge by seeing that.

Praemunire answered 3/6, 2015 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.