-
New Feature
-
Resolution: Fixed
-
Normal
-
None
-
None
-
Security Level: Jimmy
-
None
-
IE10+
-
ZK 8.0 UI Pattern S1
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).