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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.0.0, 7.0.7
    • Fix Version/s: 8.0.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • gh.sprint.customfield.default.name:
      ZK 8.0.2 S1

      Description

      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.

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

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