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

Support a Match Media annotation for MVVM to use

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Normal
    • 8.0.2
    • None
    • None
    • Security Level: Jimmy
    • None
    • IE10+

    • ZK 8.0 UI Pattern S1

    Description

      For RWD, we need a way to monitor if the browser screen has matched with some criteria which is listed in this media queries spec.

      The usage in ViewModel is like this.

      
      @MatchMedia("(max-width: 700px)")
      @NotifyChange("matchMedia")
      public void mediaQuery(@ContextParam(ContextType.TRIGGER_EVENT) ClientInfoEvent evt) {
              if (evt.isMediaMatched()) {
                  // ...
                  _matchMedia = true;  
              } else {
                  // ... 
                  _matchMedia = false;  
              }
      }
      

      As you can see above, if the media queries has matched, the mediaQuery method will be invoked, and its trigger event will be ClientInfoEvent with two new methods, boolean isMediaMatched() and String getMedia().

      According to the media queries' spec. we can only support this feature for IE10+. (Please note it in Javadoc as well).

      Attachments

        Issue Links

          Activity

            People

              wenninghsu wenninghsu
              jumperchen jumperchen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 2 days, 5 hours
                  1w 2d 5h