genericForm.processBack() method

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

Moderators: jwitt, sruffell, malcolmd, Moderator

genericForm.processBack() method

Postby mollett » Wed May 15, 2013 2:50 pm

Is there an example of what could/should be done in the genericForm.processBack() method? I've got a numeric field and this method is getting called whenever the Back soft key is pressed. I didn't even realize the callback method was available until I got the following error:

genericForm.js:566: TypeError: Object #<Object> has no method 'processBack'
this.formObjects[this.activeForm].processBack();
^
TypeError: Object #<Object> has no method 'processBack'
at Object.onBack (genericForm.js:566:36)
at Input.onsoftkey4 (native)
at Input.<anonymous> (unknown source)

Is the goal of the "Back" button to go back to the previous screen, if any, or to move backwards (without destructive delete) in the current string? Also, is there a way to turn it off?
mollett
Newsterisk
 
Posts: 25
Joined: Mon Apr 01, 2013 12:03 pm

Re: genericForm.processBack() method

Postby sruffell » Thu May 16, 2013 12:07 pm

Hi mollet,

It's used when there are multiple forms and you want to return to the previous screen without submitting the current one. If you only have a single level, back should just background / close the app.

There is no way to disable it that I can see.

I've added a default handler that will just background the application in the weather.app in the http://github.com/digium/digium-phone-apps repo.
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm

Re: genericForm.processBack() method

Postby mollett » Thu May 16, 2013 12:16 pm

Thanks, Shaun. Might I suggest that it be labeled "cancel" rather than "back?" Since it's right next to the "delete" soft key, the term "back" can be a bit confusing, at least to me.
mollett
Newsterisk
 
Posts: 25
Joined: Mon Apr 01, 2013 12:03 pm

Re: genericForm.processBack() method

Postby sruffell » Thu May 16, 2013 12:49 pm

Yeah, I can see that. Or maybe at least be configurable?
sruffell
Oldsterisk
 
Posts: 200
Joined: Fri Jan 07, 2011 2:02 pm


Return to Digium Phone API

Who is online

Users browsing this forum: No registered users and 1 guest