@Target(value=METHOD)
@Retention(value=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
Modifier and Type | Required Element and Description |
---|---|
java.lang.String[] |
value |
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.