开发者

how to set dynamically value to the webos IntegerPicker

开发者 https://www.devze.com 2022-12-13 09:37 出处:网络
How do I set value dynamically to开发者_开发知识库 the integerpicker?First insert a interpicker to your html scene:

How do I set value dynamically to开发者_开发知识库 the integerpicker?


First insert a interpicker to your html scene:

<div x-mojo-element="IntegerPicker" id="integerpickerId" class="integerpickerClass" name="integerpickerName"></div>

Then instantiate the picker in the Scene-assistant.js file in the setup function:

MainSceneAssistant.prototype.setup = function() {

    this.controller.setupWidget("integerpickerId",
             this.attributes = {
                 label: 'Number',
                 modelProperty: 'value',
                 min: 0,
                 max: 20

             },
             this.integerPickerModel = {
                 value: 5
             });}

You can than change the picker dynamically by setting the model:

this.integerPickerModel.value = 10;
this.controller.modelChanged(this.integerPickerModel, this);

This works for the most widgets in webos, like pickers and textfields.

0

精彩评论

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