tags:

views:

86

answers:

1

set value dynamically to the integerpicker send me the code

A: 

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.

AlexVogel