|
Page Segmentation
Example of segment entry is shown below.
SEGMENT DESCRIPTORS |
id |
type |
visible |
enable |
valuue |
base-page-id |
extends |
event-id |
description |
| header |
dynamic-include |
|
|
{bakingBean.
headSource} |
|
|
|
|
Unlike character stream based platform that arbitrary demarcations could be placed on the page, the division of a page to segment is more streamlined on the component based platform.
The division of the page would be along the lines of panels, containers, includes, etc.l. This is a common concept behind components, and having components that are containers, that could contain one or more other components.
There is no restriction on mixing layout tags like table, row <tr> or cell <td> in demarcating a page. What is in question is the demarcation of page for the purpose of dynamic behavior applications.
dWebSpec defines some segment types. For these to be relevant for usage with JSF, for behavior application, they must have equivalent components. These correspondences are shown below. The last three segment types are called the include type; they are the subject of discussion of the next section.
| dWebSpec segment | type | JSF |
| <table> | inline | h:gridPanel |
| <theader> | inline | f:facet name="header" |
| <tbody> | inline | The portion of the table between header and footer, and organized into rows of columns |
| <tfooter> | inline | f:facet name="footer" |
| <frame> | dynamic-include | |
| <iframe> | dynamic-include | |
| <div> | inline | |
| <row> | inline | |
| <td> | inline | |
| <layer> | inline | |
| aws - inline | | h:groupPanel |
| aws - static-include | static-include | <@include file= ""/> |
| aws - dynamic-include | dynamic-include |
<jsp:include page="included.html" />
<f:subview> |
| aws - insert-include | insert-include | |
From the table above, it could be seen that there are two main containers provided, namely PanelGroup and PanelGrid.
The other relevant segments are <theader>,<tbody> and <tfooter>. However, these are not really container components, they are called facets. By definition, a facet represents a named section within a container component. As such, although they could participate in segmentation, behaviors could not be applied to them; they actually have ?name? as the single property. Any of the defined facet, remember <tbody> is not explicitly defined, would accept a single component, and would need another container within, to hold multiple components.
For the purpose of behavior application, segments have the following attributes.
| Segment Attribute | JSF Container Attribute |
| visible | rendered |
| enabled | There is no enabled equivalent. This must be recursively applied to the input elements within the container. |
Segment Reuse
Segment reuse has two forms. 1) The master or template page that has segment defined within that could be overridden or replaced. Pages would use these templates and override them as appropriate. Any page could be a template, it is the segments of the ?insert? type that would delineate a segment as override-able. The insert type is defined in the segment descriptor, and it is within the page descriptor that a page could indicate what page it is using as a template.
2) Another means of re-use is to include dynamically or statically other pages. For specification of segment to include, dWebSpec provides two attributes a) the base-page-id that indicate the page the segment reside, and b) extends that carries the segment-id to include.
Standard JSF does not include segment re-use or templates; this has been one of the driving forces for the shift towards the use of Facelet, instead of the JSP used by the reference implementation. Facelet is comprehensive in its inclusion of such features; the dictionary provides information on this in the discussions for the Seam Platform.
Whatever facilities that are available for segment re-use, or segment of the include type, are available from the JSP/Servlet platform.
AJAX
All the segmentation and segment reuse discussed above, have to do with initial rendering or re-rendering on post-back, for the page. There is another type of re-rendering involving AJAX. This has gained popularity these days, in making web application appear highly interactive, on the level of desktop applications.
To mark a segment for re-rendering, all that is needed is to include an event-id entry for the segment. This id would belong to the AJAX event descriptor entry.
JSF does not come bundled with AJAX components; the Seam platform however does, for which discussion is explored for this subject.
More details are available in the attributes descriptions
id
type
value
event-id
visible
enabled
base-page-id
extends
description
|