0

Currently I am building a hybride app for android devices. I am trying to use the ojInputNumber component to force a numeric keyboard show up on the device. Unfortunately, the component binding always gives type="text".

I have a list of objects which contains traits, while looping over traits, the following snippet will be loaded on screen based on the entrytype.

<div class="inputNumberWraper" data-bind="if: trait.getEntryType() === 'MANUALNUM'"> 
        <input class="inputNumer"
               data-bind="attr: {id: trait.getTraitCode()}
                        , ojComponent: {component: 'ojInputNumber'
                                        , value: trait.getValue()
                                        , min: trait.getMinValue()
                                        , max: trait.getMaxValue()
                                        , optionChange: changeListener
                                        , required: trait.isMandatory() }"/> 
        <span data-bind="ojModule:{name: 'inputComponents/inputNumberFixer'}" />
    </div>

I have tried to load a module (inputNumberFixer) after this the component is binded. To manually change the input type from text to number with jquery.

$(document).ready(function(){
            $('.inputNumer').attr("type", "number");
            $('.oj-inputnumber-button').hide();
        });

this works until I select another object from the list and the input fields "refreshed". The type I have changed is put back to text but the inputnumberfixer did not run for the 2nd time.

Does anyone know how to force this component to bind the input type to number?

Alex Poole
  • 183,384
  • 11
  • 179
  • 318

1 Answers1

1

Unfortunately, no. There is not a way to force this today(v2.0.0 of JET). The ojInputNumber component is a generated component that provides the "spinner" option for easily increasing and decreasing the number value, but it does not set the number type so that the proper number keyboard shows up on a mobile device.

I've filed an ER for this to be fixed to show the proper keyboard. It should change in a future release.

peppertech
  • 495
  • 2
  • 9
  • Hi, thanks for the answer. Do you have any link where I can refer to? – Lai Ho Yeung Apr 11 '16 at 11:01
  • I filed it internally. You can do a couple of things to watch for the change. 1) follow on @oraclejet on twitter to hear about updates when they come out. 2) File a similar issue on the https://github.com/oracle/oraclejet/issues site and we will update that as well when we know more info. – peppertech Apr 11 '16 at 19:24