Annotation Type MatchMedia


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface MatchMedia

    Marker annotation to identify a MatchMedia method in View Model.
    A MatchMedia method could also use with ContextParam to get the ClientInfoEvent.
    The annotated methods are not in any particular order if the intervals are overlapping.

    This annotation is for RWD in zk mvvm.

    Example:
    @MatchMedia("all and (max-width: 500px)")
    public void method(@ContextParam(ContextType.TRIGGER_EVENT) ClientInfoEvent event)

    When the media query matches the value in the annotation, it'll trigger a ClientInfoEvent and the annotated method in the viewmodel will be invoked .
    You could get the client's information by ContextParam

    The values of this annotation should be unique in each viewmodel, and has to follow the criteria which is listed in this media query's spec

    Since:
    8.0.2
    Author:
    wenninghsu
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String[] value  
    • Element Detail

      • value

        java.lang.String[] value