2014-05-06 13:19:52
JavaScript Error:
Error: Could not execute returned javascript: Xojo.controls.QdYTJxlz is undefined^M
Source: Xojo.controls['QdYTJxlz'].setVisible(true);^M
Xojo.refreshControl('AZMtjVYR');^M
Xojo.refreshControl('AEW1zs3A');^M
Xojo.refreshControl('SxHE767c');^M
Xojo.refreshControl('P2wfBkBn');^M
Xojo.refreshControl('CjyzzsUX');^M
Xojo.refreshControl('Rhou2fJa');^M
Xojo.refreshControl('GIE1C4Gu');^M
Xojo.refreshControl('Z5L4ALoQ');^M
Xojo.refreshControl('LOUfMd3I');^M
Xojo.refreshControl('Jby4fLEz');^M
Xojo.refreshControl('K2bEafxI');^M
Xojo.refreshControl('A3cNkUXq');^M
Xojo.refreshControl('VUdOk65h');^M
Xojo.refreshControl('QgM85OMB');^M
Xojo.refreshControl('FTLqNEVJ');^M
Xojo.refreshControl('L1e9t06o');^M
Xojo.refreshControl('J6Sb6c6e');^M
Xojo.refreshControl('ChtUqhQw');^M
Xojo.refreshControl('FYZDMGHN');^M
Xojo.refreshControl('BIAafMTC');^M
Xojo.refreshControl('LC0Yp2Om');^M
Xojo.refreshControl('Rp7GrS9D');^M
Xojo.refreshControl('Mq3GEAQN');^M
Xojo.refreshControl('Eatu6dC9');^M
Xojo.refreshControl('E7AcXxUx');^M
Xojo.refreshControl('LLiczEVw');^M
Xojo.refreshControl('KGABwHS5');^M
Xojo.refreshControl('KRcLtZXa');^M
Xojo.refreshControl('SBrpLIdI');
User Details: Logged in, chose TST from client chooser, clicked on Group once, didn't seem to come up, so I clicked abgain after a couple seconds.
Attempting to repeat the process, everything works. The user can not reproduce it either but I’m sure its not going away.
This just means that the control didn’t get created on the client side yet. At this point, with a lot of these fixed, the remaining ones seem (in my opinion from debugging the guts out of it) to be because the client side makes no effort to serialize responses from the server. So the response from server manipulating controls is getting there before the one that creates them. WebSockets would fix that. I’m seeing this a lot when dealing with dynamic controls, more frequent as the number of controls grows.
If you’re doing dynamic controls, if you can unroll the code so that manipulation starts from the Shown event of the dynamic control rather than looping through new controls after creating them, you might be able to avoid this. I’m faced with the general problem on a couple projects now and still trying to find something that works well.
Was it dynamically created controls? If so, are you doing it via “Add” syntax or “EmbedWithin”? Knowing one of these is the case would help me craft a robust workaround (eventually).
Yes. I have a main page and a toolbar. The user pressing a toolbar button will create a new container control (designed already and compiled in with my app) of a given type and use EmbedWithin to embed that new container control into the main window. Sorta like a tab bar, but only 5 possible tabs.
[quote=86158:@Norman Palardy]Are you setting something visible in the open event ?
That’s unlikely to work correctly given how the framework functions.[/quote]
No, I am not. I’ve been bit by that in the past. I just double checked to make sure.
[quote=86174:@Jeremy Cowgar]Yes. I have a main page and a toolbar. The user pressing a toolbar button will create a new container control (designed already and compiled in with my app) of a given type and use EmbedWithin to embed that new container control into the main window. Sorta like a tab bar, but only 5 possible tabs.
[/quote]
Yeah, it seems this became a giant mess around 2013r3. But I’m guessing it was revealed because other things were fixed that would get in the way first :-).
If you try unrolling your code so new containers get properties set when their Shown event fires, could you let us all know how that works for you?
Alternatively, if you just have one instance of each container, and client side memory isn’t a concern, you could put them all offscreen in the IDE and move them into the page as needed. Set container.top = -100 - container.height to force offscreen.
I have a dialog that has 4 main container controls. I use a Segment control to switch between them. I placed them all on the dialog at the right X,Y,Width,Height and toggle their visibility flag as needed.
Is it better to move them offscreen than toggle the Visibility flag?
I both move offscreen and set the visible flag. It’s probably overkill. That aside, is there a reason you’re creating those containers dynamically rather than just putting instances in the IDE? The typical reason to create controls dynamically is when you need some variable number of them > 1 available at a time. For example, a list of record cards or maybe image thumbs in a scrapbook.
Probably 70% of the time, only 1 of them will be used. All of them have database activity going to initialize some of the widgets (popup menus for example). So I just though it’d be better not create them until and if I actually needed them.
[quote=86174:@Jeremy Cowgar][quote=86158:@Norman Palardy]Are you setting something visible in the open event ?
That’s unlikely to work correctly given how the framework functions.[/quote]No, I am not. I’ve been bit by that in the past. I just double checked to make sure.[/quote]Things have changed from the past. I know, nobody believes me about this, but just for debugging purpose, try to move you visibility switch from the Shown event to the Open event, and see what happens. (if it changes anything in your case).
You may ignore my suggestion. My Websites are online though, with dynamic containers, resizing/moving/hiding/showing effects. I don’t get Javascript errors. That does not mean it will work for you, but at least, try it, don’t blindly follow and old belief.
I may not have much credits in your eyes but just for your information, I’ve been doing C/C++ development for more than 20 years, I’ve been head of R&D for a visual effect company, so if I’m saying moving some control manipulations from the Shown event to the Open event solves some of this kind of issues, it’s because I know what I’m talking about (until proven otherwise, which did not happened yet).
And I’m not trying to show off or something, I’m just trying to help with concrete experiments and results I got on my side.
[quote=86318:@Guy Rabiller]You may ignore my suggestion. My Websites are online though, with dynamic containers, resizing/moving/hiding/showing effects. I don’t get Javascript errors. That does not mean it will work for you, but at least, try it, don’t blindly follow and old belief.
I may not have much credits in your eyes but just for your information…[/quote]
Anyone willing to take time out of their day to help another has a lot of credit in my eyes! Thanks, I will certainly try your suggestion.