2 Replies Latest reply on Jun 7, 2013 5:48 AM by Bogdan-Adrian Stefan

    Undocumented asl.showKeyboard method returns wrong callback data

    Bogdan-Adrian Stefan

      Hello,

       

      I've discovered an undocumented Keyboard Services method in the ASL API. It's called 'asl.showKeyboard'.

       

      Here is its stub:

       

      asl.showKeyboard = function(params, callback) {

          asl.events.fire(asl.events.types.focusOut);

          asl.prv.inputs[params.inputId] = {

              callback: callback

          };

       

      From my understanding, it can receive an array of parameters and a callback function. It returns a value from an input field, defined by inputId (from the parameters array) to the callback function.

       

      I've done the following:

      asl.showKeyboard( {

           inputId: 'item_code',

           title : 'Please scan an item',

           type : 'text',

           scanner: true,

           back: false

      },

      function(scanned_item_code)

      {

           app_function(scanned_item_code)

      });

       

      However, inside my callback function the local parameter scanned_item_code's value is always scanned_item_code, instead of the scanned value.

       

      Any suggestions on what might be wrong?