Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3084

An EL in a command binding cannot access "event" object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.0.2
    • 8.0.0, 7.0.7
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.0.2 S1
    • None

      steps to reproduce

      1. load the zul
      2. click the button "event"

      result

      it prints "true" with the event object

      expected result

      it prints "false" for event is not null.

      debug info

      • From a specification view, an EL expression should be able to access all implicit objects according to http://books.zkoss.org/wiki/ZUML%20Reference/EL%20Expressions/Implicit%20Objects%20(Predefined%20Variables)
      • we can pass the event as a parameter but cannot access it in an EL expression. (inconsistency)
      • related code
        				command = (String) eval.getValue(null, comp, ((CommandBindingImpl)_commandBinding).getCommand());
        				if(!Strings.isEmpty(command)){//avoid the execution of a empty command.
        					
        					//ZK-1032 Able to wire Event to command method
        					Map<String,Object> implicit = null;
        					if(_implicitContributor!=null){
        						implicit = _implicitContributor.contirbuteCommandObject(BinderImpl.this,_commandBinding,event);
        					}
        ...					
        				}
        

        only _implicitContributor contains event, when evaluating a command name, the context doesn't contain event.

        1. 3084.zul
          0.4 kB
          hawk
        2. ZK3084VM.java
          0.4 kB
          hawk

            DevChu DevChu
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours
                7h