@Target(value=FIELD) @Retention(value=RUNTIME) @Documented public @interface ClientSideState
Component
properties to indicate the property
value should be exposed in the client and populated back from the client
Some components have state that can be altered on the client without making a server call. An
example of this is the open state for an Disclosure
. When the View is refreshed
from the server, the refreshed state needs to reflect the last state before the refresh was made. The
framework supports this exposure of state in the client and syncing of the client state to the server
component by means of this annotation.
During the finalize phase, values for properties that contain this annotation will be pulled and added
to the ViewState object that is exposed through JavaScript. The property name/value pair is associated
with the component id on the ViewState object so that the state can be updated when the view is refreshed.
Properties exposed client side can also be accessed and updated by custom script.
e.g.
var componentState = ViewState['componentId']; // or ViewState.componentId
var propertyValue = componentState['propertyName'];
The property will be exposed client side with the identifier given by variableName()
. If not specified,
the name of the property for which the annotation applies will be used
Modifier and Type | Optional Element and Description |
---|---|
String |
variableName
Identifier to expose the client side variable as, can be left blank in which case
the name of the property the annotation is associated with will be used
|
public abstract String variableName
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.