« Trace with parameter … | Home | Invitation à la 7e Co… »

Heads up for open events in Xojo Web 1

While debugging a bigger Xojo application written in Web 1 this week, we repeatedly run into the same issues. The web framework regularly and reproducible cause problems in JavaScript when an object gets accessed before it is created.

Over the days on debugging, I reproduced this for a couple of methods if those get called in the Open event. Please note the Open event is run before the control is constructed in the browser, while the Shown event is run after its creation.

To Identity possible cases, we when through controls and set hundreds of properties and called hundreds of methods to figure out possible candidates. Later we search those in our big project to check if one of our bug reports is caused in such a way. I got this list of candidates:
  • WebControl.AllowRawDataDrag
  • WebControl.ContextualMenu property
  • WebControl.PresentContextualMenu
  • WebControl.SetFocus
  • WebFileUploader.CancelUpload
  • WebMoviePlayer.FastForward
  • WebMoviePlayer.FastForwardStop
  • WebMoviePlayer.FastRewind
  • WebMoviePlayer.FastRewindStop
  • WebMoviePlayer.GoToBeginning
  • WebMoviePlayer.GoToEnding
  • WebMoviePlayer.Mute
  • WebMoviePlayer.Play
  • WebMoviePlayer.Position
  • WebMoviePlayer.Stop
  • WebMoviePlayer.Volume
  • WebTextArea.ScrollPosition property
  • WebTimer.Reset
The list may not be complete, but if one of them gets called in an open event, you may risk the famous JavaScript error box.

By the way for Web 2 the Xojo engineers put in a lot of effort to eliminate this problem. Let us know if you find the same problem in Web 2 somewhere or more cases in Web 1 where it happens.
25 01 22 - 17:02