English 中文(简体)
how to set dynamically value to the webos IntegerPicker
原标题:
  • 时间:2009-12-04 07:20:04
  •  标签:
  • webos

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.

问题回答

暂无回答




相关问题
Orientation Questions - palm pre webos

Just a couple of quick questions...not too hard to answer hopefully! How do I set the allowed orientation from scene to scene? I can set it for the entire stage with: this.controller....

How to set default language in WebOs

How can I set the dault language of an WebOs project? The standard way of adding internationalization in WebOS is to use the $L() function, where I can set a key to the translated string. But if the ...

push scene by tapping on image

push scene by tapping on image. i am using one image when i am tap that image i want to push the new scene. it is not working. is there any way to push the scene when tap on image controle it showing ...

Is it possible to use d8 to measure memory usage?

With the release of the Closure compiler, I was hoping to see if there was a difference in memory usage between a js file using the compiler and one which had not. In particular, on a mobile ...

热门标签