-
Bug
-
Resolution: Fixed
-
Major
-
8.5.0, 9.5.0.1
-
Security Level: Jimmy
-
ZK 9.5.1 S1
-
None
Steps to Reproduce
run the attached example
./gradlew startJettyRunner
http://localhost:8080/wpd-race/
wait for components/widgets to be added/render dynamically via server push
Current Result
while components/widgets render as expected
-> related wpd files are loaded on demand, when widgets are instantiated
-> JS ERROR happens when a JS method is invoked on the 4th widget, too early
zk.wpd:30474 Uncaught TypeError: Cannot read property 'apply' of undefined at Object.invoke (zk.wpd:30474) at doProcess (zk.wpd:28681) at zk.wpd:28643 at Function.zk.afterMount (zk.wpd:26916) at dataNotReady (zk.wpd:28638) at doProcess (zk.wpd:28651) at doCmdsNow (zk.wpd:28780) at Object._doCmds (zk.wpd:29144) at mtAU0 (zk.wpd:27086) at doEnd (zk.wpd:26472)
Expected Result
no JS error, invoking JS on a component that's still being rendered should wait for it to become available
Debug Information
the example used a fixed delay to simulate network latency in zk.support.debug.MyWpdExtendlet
This can be changed in zk.support.debug.WdpRaceComposer
If too small the problem will occur less predictable.
there are 2 ways to cause a problem (2nd commented out in the composer)
- Clients.response(new AuInvoke(component, "setStyle", "color: green;")); //causes client side error
- ((HtmlBasedComponent)test).setStyle("color: green"); //silently fails at client side