Images sporadically not showing after switching to ServerPush

asked 2014-08-28 13:02:49 +0800

ansancle gravatar image ansancle
317 9

I have a ZK application which has been in production for years. We used a timer to call the server every 500ms on pages to allow visual updates to take place that were generated from the server via the onTimer event handler. This has worked perfectly for years. I switched us over to use comet server push and have run into some very sporadic and strange issues with regards to the icons in our application.

This ONLY HAPPENS ON THE IPAD - everything works correctly on all desktop browsers. I have an ipad simulator that runs on windows - I can't reproduce the problem there.

I have custom made buttons that I wrote which are basically Vbox's and Hbox's with a label and image in them, nothing too complicated. I use the path to my images to set the button images :

String imagePath = "/myapp/foo/pathtoimages/myimage.png"
Image buttonImage = ....

This has worked perfectly forever, I can update the backgrounds of the containing vbox, change the parents styles, and do any other updates without my icons vanishing. Since I changed over to comet server push, I am getting intermittent icons not appearing. Which ones are not visible changes and is not consistent. Buttons right next to each other that were created in an identical way will have one with a visible icon, another the icon is not showing up. I also had to remove the "invalidate" tags I had places on some buttons in the past to force changes to the client since we had issues with changes not showing up. Those invalidate calls now cause the images to disappear. They would flash and then go away.

I can't debug it since there is no consistency at all.

It has something to do with the server push since this behaviour wasn't occurring when using the client side timer to ping the server.

I know I'm grasping at straws, but if anyone has any ideas let me know Thanks!

delete flag offensive retag edit


I noticed that it only happens with images that are not visible when the screen draws. I have numerous cardlayouts and other components where things are drawn but not visible until the user does something. It's only with buttons that are not visible initially on the screen that this is happening.

ansancle ( 2014-08-28 15:41:39 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-09-02 10:43:33 +0800

ansancle gravatar image ansancle
317 9

updated 2014-09-02 10:57:45 +0800

From Vincent at ZK - this is an IOS Browser Bug :

This is a known iOS safari browser issue, please refer to the trakcer http://tracker.zkoss.org/browse/ZK-1539 for more information. As a workaround, you can use polling server push on iOS, for example, if (Servlets.isBrowser(useragent, "ios")) { desktop.enableServerPush(new PollingServerPush()); // use polling server push for iOS } else { desktop.enableServerPush(true); }

Slight Change to code in quotes - here is the correct code :

        desktop = Executions.getCurrent().getDesktop();
    if (desktop.isServerPushEnabled() == false) 
        if (DHzZKUtilities.isIpad() == true)

link publish delete flag offensive edit

answered 2014-11-06 12:19:21 +0800

ansancle gravatar image ansancle
317 9

I just upgraded to IOS 8.1 and that seems to have eliminated this problem, all of my images are now showing correctly. So it looks like apple finally fixed this.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2014-08-28 13:02:49 +0800

Seen: 11 times

Last updated: Nov 06 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More