Event handlers stop listening after error with elements not existing (yet)

To preface this, I sent this request to the support line on the website, so there may still be some things that reference support. I am a student, but I was not able to log into the forum with a student account.

I don’t know if this is exactly a bug or not, but I am having problems with some things in AppLab. I am working on a project for my computer science class in which I am making a notes app that will add notes with a plus button. I am having a couple of problems. A couple of these I have not been able to find a solution, so I have had to go the long way around.

The first problem that I have kind of fixed is the fact that I have not been able to find a way to create a new screen in the code. I have looked through the documentation, but have not been able to find a command for it. To get around this I have just created all of the pages beforehand, but I still want to be able to give the appearance of creating more pages, so I am trying to create more text inputs that correspond to the note pages that I have already created.

The problem that I am coming across is that when I create these text inputs and the edit buttons that correspond to them, I have to also create event handlers in the code beforehand because if you can create more code with commands, then I don’t know how and can’t find anything on it. Whenever I start the program, all of these premade event handlers error out because their element ids do not exist yet, and when they are created it seems that the code has already decided to ignore them, and they will not function.

So along with this, I have a couple of questions. Can you create a new page with a command in the documentation that I just skipped over? Is there a way to make these event handlers within my code so that I can avoid this error altogether? or is there some way that I can fix these errors, or force the program to listen to the event handlers? or am I just missing something obvious in my program?

This is the link to the program, and I have attached an image showing my problem.

Annotation 2019-12-12 180120.png

You can’t dynamically create UI objects and code as your program is running. You will have to create all the UI controls and their corresponding events when you are creating your app, but keep the unneeded UIs hidden making them visible as you need them.

1 Like