Class ClientPersistentFieldStrategy
java.lang.Object
org.apache.tapestry5.internal.services.ClientPersistentFieldStrategy
- All Implemented Interfaces:
LinkCreationListener2,PersistentFieldStrategy
public class ClientPersistentFieldStrategy
extends Object
implements PersistentFieldStrategy, LinkCreationListener2
Implements simple client-persistent properties. Most of the logic is delegated to an instance of
ClientPersistentFieldStorage. This division of layer allows this service to be a true singleton, and a listener to
the LinkSource, and allow per-request state to be isolated inside the other service.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatedComponentEventLink(Link link, ComponentEventRequestParameters parameters) Invoked when an action link (a link that asks a component to perform an action) is created.voidcreatedPageRenderLink(Link link, PageRenderRequestParameters parameters) Invoked when a page link (a link that renders a page) is created.voiddiscardChanges(String pageName) Discards any saved changes for the name page.gatherFieldChanges(String pageName) Finds all persistent changes previously stored for the named page (for the current active session or client).voidpostChange(String pageName, String componentId, String fieldName, Object newValue) Posts a change of a persistent property.
-
Constructor Details
-
ClientPersistentFieldStrategy
-
-
Method Details
-
gatherFieldChanges
Description copied from interface:PersistentFieldStrategyFinds all persistent changes previously stored for the named page (for the current active session or client).- Specified by:
gatherFieldChangesin interfacePersistentFieldStrategy
-
postChange
Description copied from interface:PersistentFieldStrategyPosts a change of a persistent property.- Specified by:
postChangein interfacePersistentFieldStrategy- Parameters:
pageName- the name of the page containing the componentcomponentId- the nested id path of the component (or null for the page's root component)fieldName- the name of the field whose persistent value has changednewValue- the new value for the field, possibly null
-
createdComponentEventLink
Description copied from interface:LinkCreationListener2Invoked when an action link (a link that asks a component to perform an action) is created. The listener may decide to encode additional query parameters into the link (viaLink.addParameter(String, String)).- Specified by:
createdComponentEventLinkin interfaceLinkCreationListener2- Parameters:
link- the newly created linkparameters- information encoded into the link
-
createdPageRenderLink
Description copied from interface:LinkCreationListener2Invoked when a page link (a link that renders a page) is created. The listener may decide to encode additional query parameters into the link (viaLink.addParameter(String, String)).- Specified by:
createdPageRenderLinkin interfaceLinkCreationListener2- Parameters:
link- the newly created linkparameters- information encoded into the link
-
discardChanges
Description copied from interface:PersistentFieldStrategyDiscards any saved changes for the name page. There is no expectation that data already gathered from the strategy and presumably dumped into component instance fields will be affected, but future field access (within this request or a later one) will show no data for the indicated page.- Specified by:
discardChangesin interfacePersistentFieldStrategy- Parameters:
pageName- logical name of page whose field persistent data should be discarded
-