Alternatively, you can configure your application so that changes persist in a permanent data repository. Doing so means that the changes remain whenever the user reenters the application. To allow this permanent persistence, you need to use the Oracle Metadata Service (MDS), which is part of the full Fusion technology stack. Using MDS and the full Fusion stack also provides the following additional persistence functionality:
Persisting additional attribute values
Persisting search criteria
Persisting the results of drag and drop gestures in the UI
Reordering components on a page at runtime
Adding and removing components and facets from the page at runtime
For information and procedures for using Oracle MDS, see the "Allowing User Customizations at Runtime" chapter of Developing Fusion Web Applications with Oracle Application Development Framework.
This chapter includes the following sections:
Many ADF Faces components allow users to change the display of the component at runtime. For example, a user can change the location of the splitter in the panelSplitter
component or change whether or not a panel displays detail contents. By default, these changes live only as long as the page request. If the user leaves the page and then returns, the component displays in the manner it is configured by default. However, you can configure your application so that the changes persist through the length of the user's session. This way the changes will stay in place until the user leaves the application.
Table 36-1 shows the changes by component that provide default personalization capabilities:
Table 36-1 Implicitly Persisted Attribute Values
Component | Attribute | UI Aspect | Affect at Runtime |
---|---|---|---|
|
|
Display or hide content |
Users can display or hide content using an icon in the header. Detail content will either display or be hidden, based on the last action of the user. |
|
|
Height of multiple components |
The heights of multiple |
|
|
Size of a panel |
Users can change the size of a panel, and that size will remain. |
|
|
Collapse splitter sides |
Users can collapse either side of the splitter. The collapsed state will remain as last configured by the user. |
|
|
Splitter position |
The position of the splitter in the panel will remain where last moved by user. |
|
|
Selected edit mode |
The editor will display using the mode (either WYSIWYG or source) last selected by the user. |
|
|
Active day |
The day considered active in the current display will remain the active day. |
|
|
Display activities view |
The view (day, week, month, or list) that currently displays activities will be retained. |
|
|
Height of a panel window or a dialog |
Users can change the height of a |
|
|
Width of a panel window or a dialog |
Users can change the width of a |
|
|
Inline dialog height |
When an inline popup dialog is launched using the ADF Faces dialog framework or an ADF taskflow, if the user manually resizes the dialog, any associated |
|
|
Inline dialog width |
When an inline popup dialog is launched using the ADF Faces dialog framework or an ADF taskflow, if the user manually resizes the dialog, any associated |
|
|
Column reordering |
ADF Faces columns can be reordered by the user at runtime. The |
|
|
Column scrollability |
ADF Faces columns can be frozen so that they will not scroll. When a column's |
|
|
Column text set to wrap or not |
The content of the column will either wrap or not. You need to create code that allows the user to change this attribute value. For example, you might create a context menu that allows a user to toggle the value from |
|
|
Selected column |
The selected column is based on the column last selected by the user. |
|
|
Column set to be visible or not |
The column will either be visible or not, based on the last action of the user. You will need to write code that allows the user to change this attribute value. For example, you might create a context menu that allows a user to toggle the value from |
|
|
Column width |
The width of the column will remain the same size as the user last set it. |
|
|
Display or hide filter |
ADF Faces tables can contain a component that allows users to filter the table rows by an attribute value. For a table that is configured to use a filter, the filter will either be visible or not, based on the last action of the user. You will need to write code that allows the user to change this attribute value. For example, you might create a button that allows a user to toggle the value from |
|
|
Mode of time range to display data on graph time axis |
The time range for the data displayed on a graph time axis can be specified for all data visualization graph components. By default, all data is displayed. The time range can also be set for a relative time range from the last or first data point, or an explicit time range. You will need to write code that allows the user to change this attribute value. For example, you might create a dropdown list to choose the time range for a graph. |
|
|
Display or hide legend for Gantt chart |
The legend for data visualization project, resource utilization, and scheduling Gantt chart components will either be visible or not inside the information panel. You will need to write code that allows the user to change this attribute value, for example, a hide and show button to display the legend. |
|
|
Hierarchy viewer layout options |
The data visualization hierarchy viewer component supports nine hierarchy layout options including a top-to-bottom vertical, tree, circle, radial, and so on. Users can change the layout in the map control panel and the last selected layout will be retained. |
|
|
Map zoom level |
This data visualization geographic map component attribute specifies the beginning zoom level of the map. The zoom levels are defined in the map cache instance as part of the base map. You will need to write code that allows the user to change this attribute value. |
|
|
Map spatial reference id |
This data visualization geographic map component attribute specifies the srid (spatial reference id) of all the coordinates of the map, which includes the center of the map, defined by starting X and starting Y, and all the points in the point theme. You will need to write code that allows the user to change this attribute value. |
|
|
Map X and Y coordinates |
This data visualization geographic map component attribute specifies the X and Y coordinate of the center of the map. The srid for the coordinate is specified in the srid attribute. If the srid attribute is not specified, this attribute assumes that its value is the longitude of the center of the map. You will need to write code that allows the user to change this attribute value. |
|
|
Gantt chart splitter position |
The position of the splitter in the panel will remain where last moved by user. |
|
|
Gantt chart time axes |
Data visualization components for project, resource utilization, and scheduling Gantt charts use this facet to specify the major and minor time axes in the Gantt chart. The time scale ( |
|
|
Graph start and end dates |
Data visualization area, bar, combo, line, scatter, and bubble graph components use this child tag attribute to specify the explicit start and end dates for the time selector. Only value-binding is supported for this attribute. You will need to write code that allows the user to change this attribute value. |
|
|
Treemap hierarchy layout options |
The data visualization treemap component supports three hierarchy layout options including squarified (nodes laid out as square as possible) and slice and dice horizontal or vertical (nodes are laid out horizontally or vertically first across the width of the treemap and then vertically or horizontally across the height of the treemap). You will need to write code that allows the user to change the layout. |
You can configure an application so that the value of the attributes listed in Table 36-1 can be persisted through the length of the user's session. For example, say your application contains a table, and a user adjusts the width of a column so that the contents all display on one line. If you configure your application to use session change persistence, when the user leaves and then returns to that page, the column will still be expanded to the previously set width.
Note:
For additional functionality, you can configure your application so that changes persist in a permanent data repository, meaning they will persist for that user across multiple sessions. To allow this permanent persistence, you need to use the full Fusion technology stack. For more information, see the "Allowing User Customizations at Runtime" chapter of Developing Fusion Web Applications with Oracle Application Development Framework.
In order for the application to persist user changes to the session, you must configure your project to enable customizations.
You configure your application to enable customizations in the web.xml
file.
To implement session change persistence:
When you elect to save changes to the session, JDeveloper adds the CHANGE_PERSISTENCE
context parameter to the web.xml
file, and sets the value to session
. This context parameter registers the ChangeManager
class that will be used to handle persistence. The following example shows the context parameter in the web.xml
file.
<context-param> <param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name> <param-value>session</param-value> </context-param>
When an application is configured to persist changes to the session, any changes are recorded in a session variable in a data structure that is indexed according to the view ID. Before the RENDER_RESPONSE JSF phase begins, the tag action classes look up all changes for a given component and apply the changes in the same order as they were added. This means that the changes registered through the session will be applied only during subsequent requests in the same session.
When you use session persistence, changes are recorded and restored on components against the viewId
for the given session. As a result, when the change is applied on a component that belongs to a fragment or page template, it is applicable only in scope of the page that uses the fragment or template. It does not span all pages that consume the fragment or template.For example, say your project has the pageOne.jsf
and pageTwo.jsf
JSF pages, and they both contain the fragment defined in the region.jsff
page fragment, which in turn contains a showDetail
component. When the pageOne.jsf
JSF page is rendered and the disclosed
attribute on the showDetail
component changes, the implicit attribute change is recorded and will be applied only for the pageOne.jsf
page. If the user navigates to the pageTwo.jsf
page, no attribute change is applied.