Annotation Interface PreserveOnRefresh


@Retention(RUNTIME) @Target(TYPE) @Inherited @Documented public @interface PreserveOnRefresh
Indicates that a previous view instance should be-reused when reloading a location in the same browser window/tab.

This annotation can also be used, when exporting embeddable web components. Place this annotation onto the class extending WebComponentExporter. This flags all the embedded components from that exporter to be preserved on refresh. Due to the challenge of uniquely identifying embedded components through refresh, when embedded, the component is identified by window name and a generated component id. This means, that if the same component instance is embedded onto two pages within the same window context, the state can be transferred between locations. To avoid state leaking, provide unique id for the embedded web component. The id must be unique across all the pages where instances of the web component are embedded.

Since:
2.0
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Set to true if refresh should also reuse partial chain components of stored view chain.
  • Element Details

    • partialMatch

      boolean partialMatch
      Set to true if refresh should also reuse partial chain components of stored view chain.

      This means that when navigating from a preserve on refresh target to a new url in the same client window context, where windowName matches, the router layouts that have been preserved will be reused without re-creation for the new route.

      Default is false so only url match is repopulated.

      Returns:
      true if partial chain match should be checked and used
      Default:
      false