Forms Not Showing

Had an issue for the last hour (maybe 2) whereby forms have not been firing their show event. The init was running but not the show.

Then in the spirit of trying something that didn’t work over and over again whilst expecting a different result (the very definition of insanity), it magically started again.

The problem survived refreshes.

It’s happened on two different forms so far today.

Ok, I think I have a pattern at least.

I’ve been copying and pasting both form code and server module code from one project to another.

It looks like, sometimes, the copied code is not registering for a while. I think this because the ctl-click which normally takes me to the definitions doesn’t work for quite a while. Then it does. I can’t seem to find a way to force it to “rescan”.

DEFINITELY weird stuff happening!
The show event in the form properties was going to the correct method yet not firing. So I put a self.form_show() call in __init__ just to make things work. I kept checking back to make sure the event had the method reference, which it did - until it suddenly didn’t.

So I put it back in and it worked fine.

I had definitely removed and re-entered the on show property many times, as well as refreshed. I’ll try and get a screen capture next time it happens, but that’s 3 times this morning, and each time I’m more confident I’ve done everything right.

(Moving to Bug Reports)

This is (very frustrating for you, I’m sure, but) great! If you can find a sequence of operations that reproduces it, we can knock it on the head!

Things to check:

  • Is the Properties->Events window showing it correctly?
  • Does pressing Ctrl+S (forcing it to save) work? (This is normally unnecessary, but I’m wondering whether any part of our versioning system is acting up)
  • Does it fix itself when you refresh your browser? (which will reload the entire app from the latest version on the server)

Another - probably related, maybe, possibly - thing.

A button was showing no signs of firing the clicked event, until I put a print statement at the top of the handler. Then the print showed and the event ran.

Now, the event had an error (it called a non-existent server function) and this only started showing in the output after the print statement was added.

So, not much help in actually diagnosing the problem (by debugging it I fixed it before I could record the screen), but I reckon my adding that line caused it to save and therefore “fix” the issue.

I’ve not seen this in any other circumstance beyond when I’ve copy/pasted from another project (that I can remember, anyway).

Yeah…this all sounds like the auto-save mechanism isn’t triggering properly. Editing the code (to put that print statement in) is triggering a save, and then things start behaving as normal.

I’m interested, next time you see this happening, to see what happens if you press Ctrl+S. Does this fix it?

(If so, then that tells us where to look – specifically, “make that every copy-and-paste triggers an autosave”. I’ve had a look, and not spotted anything in that neighbourhood yet, but the more we narrow it down, the more likely we are to get it replicated so we can fix it!)

1 Like

3 posts were split to a new topic: Form Show Event Not Firing