Understanding error message

Hi,

I receive from time to time this message. I understand that some of my WebPopupMenus and WebListBoxes could not be filled.

What can cause that? Sometimes it works, sometimes it doesn’t. The database is a local PostgreSQL for debugging.

Here is the massage :

Could not execute returned javascript: Xojo.controls.ZxeDZIxp is undefined Source: Xojo.controls['ZxeDZIxp'].deleteAllRows(); Xojo.controls['ZxeDZIxp'].appendRow("Tous les projets"); Xojo.controls['ZxeDZIxp'].appendRow("2017"); Xojo.controls['ZxeDZIxp'].appendRow("2018"); Xojo.controls['ZxeDZIxp'].appendRow("2019"); Xojo.controls['ZxeDZIxp'].appendRow("2020"); Xojo.controls['ZxeDZIxp'].appendRow("2021"); Xojo.controls['ZxeDZIxp'].appendRow("2022"); Xojo.controls['ZxeDZIxp'].appendRow("2023"); Xojo.controls['y8rS7xfc'].deleteAllRows(); Xojo.controls['y8rS7xfc'].insertRow(0,["COL-P-00001","BOOTCAMP2018","","2018-02-21","2018-02-28","En attente"]); Xojo.controls['y8rS7xfc'].insertRow(1,["COL-P-00002","Cartier 2018","","2018-06-01","2018-06-30","En cours"]); Xojo.controls['y8rS7xfc'].insertRow(2,["COL-P-00003","TCE 2018","","2018-02-21","2018-02-21","En attente"]); Xojo.controls['y8rS7xfc'].insertRow(3,["COL-P-00004","EDF 2018","","2018-02-21","2018-02-21","En attente"]); Xojo.controls['y8rS7xfc'].insertRow(4,["COL-P-00005","SELECTION2018","","2018-02-21","2018-02-21","Cdul"]); Xojo.controls['y8rS7xfc'].setSelectedRows([0]); Xojo.controls['y8rS7xfc'].refresh(); Xojo.controls['QSkPWZ1y'].deleteAllRows(); Xojo.controls['CZnCElk9'].deleteAllRows(); Xojo.controls['CZnCElk9'].appendRow("Inspection de pale"); Xojo.controls['CZnCElk9'].appendRow("Rparation de pale"); Xojo.controls['QSkPWZ1y'].refresh(); $( '#wVgZY5nU').trigger( 'resize'); Xojo.controls['vyQywTZ1'].setEnabled(true); Xojo.controls['vyQywTZ1'].refresh(); Xojo.controls['ZxeDZIxp'].setValue(2); Xojo.controls['QnrUJiFV'].setEnabled(true); Xojo.controls['QnrUJiFV'].refresh(); Xojo.controls['GvFk6WNc'].setEnabled(true); Xojo.controls['GvFk6WNc'].refresh();

you probably have code in the .Open event of some controls wich are not usable in the browser yet.

Try to move your code from .Open to .Shown for web projects.

Hi Derk,

I checked but it is not the case. What does that mean when a control is undefined?

When I put breakpoints, the error never occurs. It is like if some steps are executed to fast and other too slowly…

I’ve been adding plugins lately and it seems to generate weird behaviors. Can it be related to the use of plugins?

What you is javascript getting a controlid that’s not there. Perhaps you have assigned something that’s not defined or not ther when you call it. Do you use web plugins?

It seems like a listbox or popupmenu or something which has .deleteAllRows. Try to search for that method and see if you call it somewhere.

Yes I do, I use some of them. One that I like a lotIt is a Window Splitter but, I found out lately that it does interfere with the WebMapViewer. It’s use is tricky since factors such as the order in which I add the containers in design mode has a great impact on how it behaves. I think I’ll disable it and see what happens…

Thanks by the way

To answer this, you must understand that the Xojo objects and objects in the web browser are different objects. Xojo connects them together on the server side. However, if the control isn’t actually an object in the browser for some reason and Xojo tries to use it as one, you will get the “%object% is undefined” error. It’s a Javascript error, and not a Xojo one.

BKSWebSplitter is indeed very particular about how it’s used. This is the result of trying to balance the Xojo objects and Javascript objects. I received your report about WebMapViewer and will look into it as soon as I can, but I am still catching up on projects from being quite ill earlier in February and March.

I don’t see the WebSplitter as the undefined object in the Javascript error above, the undefined object is a Listbox. The line triggering the refresh may be the WebSplitter, and if that were the case, it would be any custom Listbox handling (in ContainerControl Event Handlers possibly?) that’s failing.

When you set up the splitter, the browser side Javascript takes note of the two containers that you’re splitting in the browser to trigger their resize events when the splitter is moved. Because the ContainerControl has to exist in the browser for this to work, it leads me to believe it’s a server-side issue, and not a browser side one.

(Thank you for sending in bugs through Mantis by the way, that makes them significantly easier to track!)