【问题标题】:Combobox not show the correct language values in struts1组合框未在 struts1 中显示正确的语言值
【发布时间】:2015-05-21 09:07:25
【问题描述】:

我将 ExtJS 和 Struts1 用于应用程序,当用户以英语使用此应用程序并显示组合框(在表单内)时,选择是另一种语言(西班牙语)但不是英语。保存表单并重新加载页面后,此参数以英语显示(但如果用户再次显示组合框,它会以西班牙语显示)。我做错了什么以正确的语言显示组合框?

会发生这样的事情:

代码有超过 4k 行,这是组合框的创建,如果您需要更多行我没有任何问题放在这里。

        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;
        }   

【问题讨论】:

  • 没有附加代码是不可能猜到的。
  • ExtJS 版本以及您如何使用本地化?

标签: forms extjs combobox struts struts-1


【解决方案1】:

检查服务器的响应。可能您为加载组合框所做的请求可能是返回西班牙语数据而不是英语数据。 可能是服务器能够将第一个请求识别为正确的本地化,但对于下一次命中它无法检测到。共享存储和代理设置的代码。也许我们可以通过看到来判断。

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-02
    • 1970-01-01
    • 1970-01-01
    • 2011-06-06
    • 2016-01-01
    相关资源
    最近更新 更多