-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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 = ....
buttonImage.setSrc(imagePath);
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!
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)
desktop.getDevice().setServerPushClass(PollingServerPush.class);
desktop.enableServerPush(true);
}
Asked: 2014-08-28 13:02:49 +0800
Seen: 11 times
Last updated: Nov 06 '14
How to stop combining commands in an ajax call ?
zk developmet is esay [closed]
Need help with scrolling horizontal tabs in Right-to-Left (Arabic)
Create tab dynamically, multitab application
Radio button value change on database value
How to implement, each user has its own session timeout time
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