【问题标题】:update list selector dynamically in webos在 webos 中动态更新列表选择器
【发布时间】:2010-04-21 16:15:40
【问题描述】:

我想动态更新列表选择器项。我设置了列表选择器小部件,如下所示

this.ConversionToNumaric= [    {label:$L('One'), value:"1", secondaryIcon:''},
              {label:$L('two'), value:"2", secondaryIcon:''}, 
              {label:$L('three'), value:"3" , secondaryIcon:''}
               ]


this.controller.setupWidget('listSelectorConversionToNumaric', {labelPlacement:'left',label: $L('To'), choices: this.ConversionToNumaric, modelProperty:'currentConversionToNumaric'}, this.selectorsModel);

the above code i am using for setup the widget 

this.ConversionToNumaric= [    {label:$L('four'), value:"4", secondaryIcon:''},
              {label:$L('five'), value:"5", secondaryIcon:''}
                           ]
                               ]
    this.currentConversionToPower.choices=this.ConversionToNumaric;                            
    this.controller.modelChanged(this.currentConversionToNumaric);

我在这里犯了什么错误我不知道但它没有更新请帮助我

【问题讨论】:

    标签: webos


    【解决方案1】:

    我得到了解决方案。我没有更新模型我正在更新其他东西

    这就是我遇到问题的方式。我通过使用 this.selectorModel 解决了这个问题

    this.selectorsModel=this.ConversionToNumaric; this.controller.modelChanged(this.selectorsModel);

    【讨论】:

      猜你喜欢
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-28
      • 1970-01-01
      • 2021-05-28
      • 1970-01-01
      相关资源
      最近更新 更多