| org.apache.tapestry.internal.structure.Page
All known Subclasses: org.apache.tapestry.internal.structure.PageImpl,
Page | public interface Page (Code) | | Represents a unique page within the application. Pages are part of the internal
structure of a Tapestry application; end developers who refer to "page" are really referring to
the
Page.getRootComponent() root component of the actual page.
One of the most important aspects of a Page is that it does not have to be coded in a
thread-safe manner. Pages are always accessed within a single thread, associated with a single
incoming request.
The Page object is never visible to end-user code. The page also exists to provide a kind of
service to components embedded (directly or indirectly) within the page.
|
Method Summary | |
void | addLifecycleListener(PageLifecycleListener listener) Adds a listener that is notified of large scale page events. | void | attached() Invoked to inform the page that it is attached to the current request. | Link | createActionLink(ComponentPageElement element, String action, boolean forForm, Object... context) Creates a link that will trigger behavior in a component within the page. | Link | createPageLink(String pageName, boolean override, Object... context) Creates a link to the named page. | void | decrementDirtyCount() Called as a component finishes rendering itself. | boolean | detached() Invoked to inform the page that it is being detached from the current request. | ComponentPageElement | getComponentElementByNestedId(String nestedId) Retrieves a component element by its nested id (a sequence of simple ids, separated by dots). | Object | getFieldChange(ComponentPageElement element, String fieldName) Gets a change for a field within the component. | Locale | getLocale() The locale for which the page is localized. | Log | getLog() Returns the log of the root component element. | String | getLogicalName() Returns the short, logical name for the page. | Component | getRootComponent() The root component of the page. | ComponentPageElement | getRootElement() The root component of the page. | void | incrementDirtyCount() Called as a component initially starts to render itself. | void | loaded() Inform the page that it is now completely loaded. | void | persistFieldChange(ComponentResources resources, String fieldName, Object newValue) Posts a change to a persistent field. | void | setRootElement(ComponentPageElement component) Invoked during page construction time to connect the page's root component to the page
instance. |
addLifecycleListener | void addLifecycleListener(PageLifecycleListener listener)(Code) | | Adds a listener that is notified of large scale page events.
|
attached | void attached()(Code) | | Invoked to inform the page that it is attached to the current request. This occurs when a
page is first referenced within a request. If the page was created from scratch for this
request, the call to
Page.loaded() will preceded the call to
Page.attached() .
|
createActionLink | Link createActionLink(ComponentPageElement element, String action, boolean forForm, Object... context)(Code) | | Creates a link that will trigger behavior in a component within the page.
Parameters: element - Parameters: action - Parameters: forForm - Parameters: context - |
createPageLink | Link createPageLink(String pageName, boolean override, Object... context)(Code) | | Creates a link to the named page.
Parameters: pageName - the logical name of the page Parameters: override - if true, the provided context is used even if empty Parameters: context - optional activation context for the page (if not provided, it is generated fromthe page itself) |
decrementDirtyCount | void decrementDirtyCount()(Code) | | Called as a component finishes rendering itself.
|
detached | boolean detached()(Code) | | Invoked to inform the page that it is being detached from the current request. This occurs
just before the page is returned to the page pool.
A page may be clean or dirty. A page is dirty if its dirty count is greater than zero
(meaning that, during the render of the page, some components did not fully render), or if
any of its listeners throw an exception from containingPageDidDetech().
The page pool should discard pages that are dirty, rather than store them into the pool.
true if the page is "dirty", false otherwise See Also: org.apache.tapestry.runtime.PageLifecycleListener.containingPageDidDetach |
getComponentElementByNestedId | ComponentPageElement getComponentElementByNestedId(String nestedId)(Code) | | Retrieves a component element by its nested id (a sequence of simple ids, separated by dots).
A nested id of '' (the empty string) returns the root element of the page.
throws: IllegalArgumentException - if the nestedId does not correspond to a component |
getFieldChange | Object getFieldChange(ComponentPageElement element, String fieldName)(Code) | | Gets a change for a field within the component.
Parameters: element - the element for which a persistent field value is required Parameters: fieldName - the name of the persistent field the value, or null if no value is stored |
getLocale | Locale getLocale()(Code) | | The locale for which the page is localized. This is set when the page is created and does not
change.
|
getLog | Log getLog()(Code) | | Returns the log of the root component element.
|
getLogicalName | String getLogicalName()(Code) | | Returns the short, logical name for the page.
|
getRootComponent | Component getRootComponent()(Code) | | The root component of the page. A convenience over invoking getRootElement().getComponent().
|
getRootElement | ComponentPageElement getRootElement()(Code) | | The root component of the page. This is the wrapper around the end developer's view of the
page.
|
incrementDirtyCount | void incrementDirtyCount()(Code) | | Called as a component initially starts to render itself. This is used to check for the cases
where a component causes a runtime exception that aborts the render early, leaving the page
in an invalid state.
|
persistFieldChange | void persistFieldChange(ComponentResources resources, String fieldName, Object newValue)(Code) | | Posts a change to a persistent field.
Parameters: resources - the component resources for the component or mixin containing the field whosevalue changed Parameters: fieldName - the name of the field Parameters: newValue - the new value for the field |
setRootElement | void setRootElement(ComponentPageElement component)(Code) | | Invoked during page construction time to connect the page's root component to the page
instance.
|
|
|