0

IE11 zoom and scroll break ZK 3.6 toolbarbuttons

asked 2014-06-25 14:09:53 +0800

huubf gravatar image huubf
69 1

Only in Internet Explorer 11

I have a <zk forEach> list of <toolbarbutton onClick="win.doSomething(self)" /> There is also a header above the list with toolbarbuttons.

Two things:

  • if the list is long and you scroll the window down, all hyperlinks give an alert with : For input string : "<some doublevalue>"; if you scroll back sometimes everything works again, but mostly it's definitely broken. A solution is to put the list in a div with it's own scrollbar. It only goes wrong if the body is scrolled. So it is necessary to remove the body scrollbars.

  • If the window's zoom factor is not 100% you get the same error if you click the hyperlink. It is possible to make it 100% using Ctrl-mousewheel and everything works.

I have no clue why this happens in IE11. It seems like all ZK-bindings are broken.

Is it only a 3.6 issue? Or is Microsoft trying to kill a good framework? Upgrade to version 5,6,7 or 8 is not an option for me, can i expect a bugfix for this?

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-07 12:54:24 +0800

huubf gravatar image huubf
69 1

I fixed this: In ZK 3.6.4 the org.zkoss.zk.au.in.MouseCommand uses Integer.parseInt() to parse mouse data[0] and data[1] ie11 return this data as doubles, so the code throws an Exception.

I changed this to Double d = Double.parseDouble(), then get d.intValue()

if loaded in /classes/ this class is used by tomcat, instead of the one in the /lib/zk*jar

link publish delete flag offensive edit
0

answered 2014-11-07 12:56:10 +0800

huubf gravatar image huubf
69 1

updated 2014-11-07 13:01:17 +0800

package org.zkoss.zk.au.in;

import org.zkoss.lang.Objects;

import org.zkoss.zk.mesg.MZk;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.MouseEvent;
import org.zkoss.zk.au.AuRequest;
import org.zkoss.zk.au.Command;

/**
 * Used only by {@link AuRequest} to implement the {@link MouseEvent}
 * relevant command.
 * patch to support doubles
 * @author huub
 * @since 3.0.0
 */
public class MouseCommand extends Command {
    public MouseCommand(String evtnm, int flags) {
        super(evtnm, flags);
    }

    //-- super --//
    protected void process(AuRequest request) {
        final Component comp = request.getComponent();
        if (comp == null)
            throw new UiException(MZk.ILLEGAL_REQUEST_COMPONENT_REQUIRED, this);
        final String[] data = request.getData();
        if (data != null && data.length != 1 && data.length != 2 && data.length != 3)
            throw new UiException(MZk.ILLEGAL_REQUEST_WRONG_DATA,
                    new Object[] {Objects.toString(data), this});

        MouseEvent event = null;
        if(data == null || data.length == 0) {
            event = new MouseEvent(getId(), comp);
        }   //no area, no coord
        else if (data.length == 1 ) {
            event = new MouseEvent(getId(), comp, data[0]);    //by area
        }
        else {
            Double d1 = Double.parseDouble(data[0]);
            Double d2 = Double.parseDouble(data[1]);
            event = new MouseEvent(getId(), comp,           //by coord
                    d1.intValue() ,d2.intValue(),
                    data.length < 3 ? 0: Commands.parseKeys(data[2]));
        }
        Events.postEvent(event);
    }

}
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

Follow
1 follower

RSS

Stats

Asked: 2014-06-25 14:09:53 +0800

Seen: 8 times

Last updated: Nov 07 '14

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