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 TypeMethodDescriptionvoid
createdComponentEventLink
(Link link, ComponentEventRequestParameters parameters) Invoked when an action link (a link that asks a component to perform an action) is created.void
createdPageRenderLink
(Link link, PageRenderRequestParameters parameters) Invoked when a page link (a link that renders a page) is created.void
discardChanges
(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).void
postChange
(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:PersistentFieldStrategy
Finds all persistent changes previously stored for the named page (for the current active session or client).- Specified by:
gatherFieldChanges
in interfacePersistentFieldStrategy
-
postChange
Description copied from interface:PersistentFieldStrategy
Posts a change of a persistent property.- Specified by:
postChange
in 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:LinkCreationListener2
Invoked 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:
createdComponentEventLink
in interfaceLinkCreationListener2
- Parameters:
link
- the newly created linkparameters
- information encoded into the link
-
createdPageRenderLink
Description copied from interface:LinkCreationListener2
Invoked 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:
createdPageRenderLink
in interfaceLinkCreationListener2
- Parameters:
link
- the newly created linkparameters
- information encoded into the link
-
discardChanges
Description copied from interface:PersistentFieldStrategy
Discards 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:
discardChanges
in interfacePersistentFieldStrategy
- Parameters:
pageName
- logical name of page whose field persistent data should be discarded
-