Your Digital Media Has Never Looked So Good

 
btpoole
Topic Author
Posts: 321
Joined: Fri Feb 15, 2013 2:08 pm

keyboarddialog Crashing

Tue May 16, 2017 6:58 pm

Something odd. I have a pin pad where user inputs a code, if the correct etc it calls a keyboard to come up to enter other info. This all worked when I used onkeyevent but have since changed to using an observer on the buttonselected. The pin pad works and enters the keyboard function. I have REM out each line to isolate the crash. Whenever it gets to m.top.dialog=keyboarddialog the code crashes and reboots. I get no error on the debugger. The code looks as follows

function setcode()
pindialog = createObject("roSGNode", "PinDialog")
pindialog.title = "Enter 5 DIGIT CODE"
pindialog.optionsDialog = false
pindialog.buttons=["OK","Cancel"]
pindialog.observeField("buttonSelected","checkbutton")
m.pad=pindialog.pinPad
m.pad.pinLength=5
m.pad.secureMode=false
m.top.dialog = pindialog
m.top.setFocus(TRUE)
end function


function checkbutton
function checkbutton()
?"in checkbutton"
?m.top.dialog.buttonSelected
if m.top.dialog.buttonSelected= 0 and len(m.top.dialog.pin)=5
?"CODE "m.top.dialog.pin
m.top.unobserveField("buttonSelected")
m.top.dialog.close = true
setpass()
else
end if
end function


function setpass()

function setpass()
keyboarddialog = createObject("roSGNode", "KeyboardDialog")
keyboarddialog.title= "Enter Phrase"
keyboarddialog.visible = true
keyboarddialog.buttons=["OK","Cancel"]
keyboarddialog.observeField("buttonSelected","statecheckbutton")
m.key=keyboarddialog.keyboard
m.key.showTextEditBox= true
m.top.dialog=keyboarddialog    'CRASH OCCURS HERE
m.top.setFocus(true)
end function


Any ideas? Like I said worked with  onKeyEvent but needed to get away from that and use observerfield. All of this takes place in a Scene. Thanks for any advice.
 
areinart
Posts: 3
Joined: Tue Jun 13, 2017 12:53 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 12:55 pm

Have you fixed this yet? I have this issue as well.
 
btpoole
Topic Author
Posts: 321
Joined: Fri Feb 15, 2013 2:08 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 12:59 pm

No luck in fixing it as is. I ended up breaking it out into 2 separate scenes to work. Really odd it works like that but not as written in the post.
 
areinart
Posts: 3
Joined: Tue Jun 13, 2017 12:53 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 1:03 pm

Oh ok so you had your Keyboard scene and Pin scene. After user pressed the "OK" from the keyboard scene it would go to the Pin scene. Something like that?
 
btpoole
Topic Author
Posts: 321
Joined: Fri Feb 15, 2013 2:08 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 1:05 pm

Yes, actually pin came first then keyboard. It worked before the 7.6 update stuff came out. After that it would not, just crashed. 
 
areinart
Posts: 3
Joined: Tue Jun 13, 2017 12:53 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 1:07 pm

Is there a possibility I could see the code? I'm sorry I am new to programming in brightscript.
 
btpoole
Topic Author
Posts: 321
Joined: Fri Feb 15, 2013 2:08 pm

Re: keyboarddialog Crashing

Tue Jun 13, 2017 1:48 pm

areinart wrote:
Is there a possibility I could see the code? I'm sorry I am new to programming in brightscript.

sent you pm

Who is online

Users browsing this forum: smason and 5 guests