#1 2016-02-09 16:36:28

datadon
Member
Registered: 2015-04-23
Posts: 108

InputBox

I get this error message when trying to use the inputbox. 

The [Label1] does not exist at this time in the app, it is in a later view.

What should I do here?  use a Setvar to define the [Label1.Text]?

or



Start of Button3 Click event
InputBox "Enter Name or Nickname or Something Cutesie" "Apply|Cancel" "My Sweets" "info" "InputBoxCallback2"
End of Button3 Click event
Resolved "C:\AB\Apps.AB\Valentine1_Compiled\www\builder\views\inputBox.html"
Start of InputBoxCallback2 app function
If "[ButtonIndex]" "==" "1"
Setvar "[Label1.Text]" "[inputValue]" "String"
Error: "'inputValue' is undefined" - Line: 289 - Char: 13 - Code: 0 - Url: http://127.0.0.1:9998/app/scripts/app.js

Offline

#2 2016-02-09 16:57:07

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: InputBox

Hello Donald,

A couple of things to consider here. Firstly, maybe you want to use the "[InputValue]" variable, and not the "[inputValue]" variable: note this is case sensitive. This may solve the "inputValue is undefined" error.

The other thing to consider is if the "Label1" control exists or not in the app's view. If you use the "InputBox" in a view which contain the "Label1" control, then there is no problem and probably fixing the first problem also fix this other.

Tell me if finally you got it Donald.

Offline

#3 2016-02-09 17:21:37

datadon
Member
Registered: 2015-04-23
Posts: 108

Re: InputBox

Well again I am humbled by my lack of error checking in my code.  I should have looked at it in more detail.

But again you spot it and I thank you for that.   You have the trained eyes of a programmer.  I have the eyes of a .....Bat. :-|

All in jest of course.  Thanks as always David.  Yes it works fine.  The Label1 does exist 3 views down the way but it works perfectly.

Offline

#4 2016-02-09 17:31:14

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: InputBox

Hello Donald,

Glad to know you got it sir. And don't worry! All programmers fall in this kind of mistakes. Me too of course. And what here matter is that you attached the error message and then I can take a look and found the possible problem's cause.

And that's what an experienced programmer does: offer the most possible information about an error. smile

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.