开发者

update list selector dynamically in webos

开发者 https://www.devze.com 2022-12-28 00:40 出处:网络
i want to update list selector items dynamically .i am set the list selector widget like following this.ConversionToNumaric= [{label:$L(\'One\'), value:\"1\", secondaryIcon:\'\'},

i want to update list selector items dynamically .i am set the list selector widget like following

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

what mistake i made here i don't know but it is not updating please help me


i got solution.i am not updating the model i am updating something else

that's way i got problem. i resolved this one by using this.selectorModel

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

0

精彩评论

暂无评论...
验证码 换一张
取 消