Breadcrumb Builder
In this topic ...
A "Breadcrumb" trail is a list of links, usually across the top of a page, indicating the navigation path the user has followed to get to the current page. Breadcrumb paths give location information and links in a backward linear manner. The user can backtrack to a previous page by clicking anywhere along this trail of breadcrumb links.
The currently selected level in the breadcrumb would be text. Since clicking it would not change the navigation, the previous levels would be links. We can specify a "separator" between levels of the breadcrumb to clearly illustrate the drill down. You would also be able to specify some text to display before the breadcrumb. This will help in case the levels may be enabled/disabled so that the breadcrumb still makes sense.
Breadcrumb Builder may be used for simple page rendering as well as for invoking methods and dynamic navigation. This Builder requires only one tag/page location on all pages that will contain a dynamic breadcrumb, constructed using repeated region. The Builder would insert a new page (that contains the base HTML for the repeated region) at this page location.
How do I...
Invoke pages by calling action (with arguments)?
In this case, the navigation from one page to another is not as direct as calling a page, but it requires calling a WebApp action that will process the page. You have the choice of selecting the value for "page display mode" input as either "Display page Directly" or "Call an action that displays page". If you select "Call an action that displays page", we need to provide a method in the "Action to display page" Builder input. The breadcrumb link for this level executes the method specified here, and the method is responsible to take the control to some page. In this case, all the levels can have different methods associated with each of them or they can directly display the page.
Specifying Inputs
The Breadcrumb Builder takes the inputs described in the table below. For help on inputs common to many or all Builders such as those in the Properties input group, see Using the Builder Call Editor.
Input Name Description Name Enter a name for this Builder call. The Designer displays this name in the builder call list. Breadcrumb Levels Text for Breadcrumb text to be used for each breadcrumb level. Page Display Mode display mode of each breadcrumb level. You can choose:
- Display page directly: To display the page directly
- Call an action that displays page: To call an action that will render the page
Action to Display Page action that will load the page. Breadcrumbs Location Tag On Pages tag (on all pages) that will locate the breadcrumbs. Breadcrumbs Appearance Title Text before Breadcrumbs text to be used as prefix for the breadcrumb nodes. Separators Between Levels Define the separator to separate the breadcrumbs levels. Example: >>
Base HTML Page URL of a base page to use as the base HTML of breadcrumb pages. Default Page:
/factory/pages/breadcrumbs.html
Breadcrumbs Stylesheet Select a style that will be applied to the background of individual pages in the breadcrumb trail. Default Stylesheet:
/factory/pages/breadcrumbsstyles.css
Title Text Style Class Select a style class to apply to the title text in the breadcrumb. Default Class:
breadcrumbsTitleText
Text/Link Style Class Select a style class to apply to the links/text nodes in the breadcrumb. Default Class:
breadcrumbsText
Separator Style Class Select a style class to apply to the breadcrumb separator. Default Class:
breadcrumbsSeparator
Advanced Current Level Selection Method Define the current level in the breadcrumb trail. You can choose:
- Current outer page in WebApp: To use the current outer page as the current level
- Custom Source: To use an existing WebApp variable in the model to determine the current level
Current Level Reference Available when Current Level Selection Method is "Custom Source." Define the custom current level in the breadcrumb trail.
Objects This Builder Creates
This Builder creates a variety of objects within the WebApp. They include the following items:
Linked Java Objects
<Buildername>
- Provides few methods to obtain values for indirect references in the Builder inputs.
Pages
<Buildername>_breadcrumbsPage
- Contains breadcrumbs text, link, separator, and breadcrumb title. This page is inserted at the location as specified in the Builder inputs.
Methods
<Buildername>_breadcrumbsGetCurrentStep
- Returns the name of the current step.
<Buildername>_breadcrumbsGetStepData
- Returns the breadcrumbsPageData XML, which contains information about all the steps in breadcrumbs.
<Buildername>_breadcrumbsGetStepState
- It takes the step name as an argument and returns, either "link" or "hide", based on the current step.
<Buildername>_breadcrumbsSelectPage>
- It takes the page name as an argument, and forwards the control to this page.
Variables
<Buildername>_breadcrumbsPageData
- This XML variable contains the breadcrumb inputs such as PageName, PageLabel, PageDisplayMode, and PageDisplayAction.
<Buildername>BreadcrumbCounterVar
- This counter variable is set by the Repeated Region.
<Buildername>BreadcrumbLoopVar
- This loop variable is set by the Repeated Region.