在 webos 中动态更新列表选择器
我想动态更新列表选择器项目。我设置了列表选择器小部件,就像
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);
我在这里犯的错误一样,我不知道,但它没有更新,请帮助我
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我得到了解决方案。我没有更新模型,我正在更新其他东西,
这就是我遇到问题的方式。我通过使用 this.selectorModel
this.selectorsModel=this.ConversionToNumaric; 解决了这个问题; this.controller.modelChanged(this.selectorsModel);
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);