genericForm not behaving

Community based support for the Digium Phone Application Programming Interface (API).

Moderators: jwitt, sruffell, malcolmd, Moderator

genericForm not behaving

Postby intellectit » Thu Jun 20, 2013 6:33 am

Hi,

I have written a fairly simple form. I have two fields using numeric input types. However it doesn't display the way I would like it to. I can't move the cursor into either of the fields. Which means I can't enter anything. Also all of eh soft keys with the exception of the "back", soft key are blank. What am I doing wrong. Any suggestions would be greatly appreciated.


Code: Select all
var app = require('app');
app.init();

var genericForm = require('genericForm');
//The array of input items to use in the form
var form_items = [
{
                'text'                      : 'Extension number',
                'setting'                : 'extension',
                'inputType'         : 'numeric',  //
                'validate'              : '[0-9]+[0-9]+[0-9]',
                'errorMsg'           : 'Must be 3 digits in length',
                'inputParams'    : {}
},
{
                'text'                      : 'Password',
                'setting'                : 'password',
                'inputType'         : 'numeric',  //
                'validate'              : '[0-9]+', //require at least one letter followed by at least one digit
                'errorMsg'           : 'Must contain digits',
                'inputParams'    : {}
}
];

genericForm.show({
                'id'                          : 'exampleForm',
                'labelWidth'        : (digium.phoneModel === 'D70') ? 140 : 125,
                'values' : {
                                'extension'          : '123',
                                'password'          : ''
                },
                'inputs' : form_items,
                'object' : this,
                'title'                      : 'Extension Login',
                'onkeyline1'        : digium.background,
                'onkeycancel'     : digium.background,
                'forceRedraw'    : true
});
intellectit
Oldsterisk
 
Posts: 112
Joined: Sun Aug 02, 2009 8:08 am

Re: genericForm not behaving

Postby sruffell » Thu Jun 20, 2013 12:32 pm

Hi intellectit,

I ran your example and noticed what you reported and then also noticed that the behavior returned to what I would have expected after calling show in the context of the digium.app.foreground event. That said, I do not know why changing the context of the call to genericForm.show() changed the behavior. But at least hopefully you aren't blocked anymore.

I created a basic genericFormExample at http://github.com/digium/digium-phone-apps which I hope will help.

Cheers,
Shaun
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: genericForm not behaving

Postby intellectit » Thu Jun 20, 2013 7:18 pm

You are a champ Shaun. That works perfectly.
intellectit
Oldsterisk
 
Posts: 112
Joined: Sun Aug 02, 2009 8:08 am


Return to Digium Phone API

Who is online

Users browsing this forum: No registered users and 1 guest

cron