MouseEvent does not inherit data

asked 2017-02-01 00:21:12 +0800

JustinFrost gravatar image JustinFrost
145 1 6

I have a custom button component with the following doClick_ in my javascript:

doClick_: function (evt) {
    evt.data.enterKeyPressed = this._enterKeyPressed;
    this._enterKeyPressed = false;
    this.$supers('doClick_', arguments);

In the java code of my widget in the service method:

public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
    final String cmd = request.getCommand();
    if (cmd.equals(Events.ON_CLICK)) {
        Event evt = Event.getEvent(request);
        MouseEvent mevt = MouseEvent.getMouseEvent(request);

The evt variable contains the enterKeyPressed in data, however if I create a MouseEvent the mevt variable has _data of null. It seems the MouseEvent.getMouseEvent(request) strips the data.

Is there a work around for this ? I need to fire a MouseEvent with the data I added on the javascript side.


delete flag offensive retag edit
Be the first one to answer this question!
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: 2017-02-01 00:21:12 +0800

Seen: 16 times

Last updated: Feb 01 '17

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