Inserted Page Builder
In this topic ...
Using Inserted Pages in Your Web Application
Related Topics ...
Use the Inserted Page Builder to insert the contents of an Imported Page or Create Page builder call into a named location in the specified page(s). For example, you might want to display a copyright message and a set of links on the bottom of every page in your application. Using the Inserted Page Builder we can build this boilerplate page once. We can also use an Inserted Page builder to insert the display of a page in a linked model into a page in the primary model.
Do not attempt to insert a page into itself. An infinite loop will result from such an operation.
Specifying Inputs
The Inserted Page 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 and HTML Attributes input groups, see Using the Builder Call Editor.
Input name Description Name Enter a name for this builder call. The designer tool displays this name in the builder call list. Page Location Use the Page Location input to specify the page or pages on which this builder call will act. See "Locating Control Builders on Pages" for detailed documentation about the Page Location Chooser and page location syntax.
Page in Model Enter the name of the page (an Imported Page or Create Page builder call) in the model that you want to insert. Handle Target Element Select the scope of the insert operation. The content you insert can:
- Add - Content is added to target as a child element of the target
- Replace - Content replaces the target element entirely
Using Inserted Pages in Your Web Application
When you use the Inserted Page Builder, you create the "inner" (inserted) page in the normal way, using either an Import Page Builder or a simple Page Builder. We can add WebSphere Portlet Factory controls to this page as you would to any other page.
In the "outer" page (the page that captures the inner page), you add a name to any convenient tag where you want to insert the inner page. This tag can be any container tag, such as a <TD> tag, a <DIV> tag, or even a <SPAN> tag. You then create an Insert Page Builder and select the outer page as the Page, and the named tag as the Control ID.
To complete the process, you specify the inner page as the Page Name item. This will insert everything that is inside the BODY portion of the inner page inside the container-tag section of the outer page, including any activated controls.
Once a page is inserted in another page, information in the HEAD tags of the page being inserted is no longer available. For example, a reference to an external style sheet will be lost once a page is inserted into another page.
SCRIPT tags within the HEAD tags of an inserted page are moved to the body of the inserted page once it is inserted in another page.
Avoiding Naming Conflicts
Whenever you insert one page into another, the potential for control name collisions exists. For example, let's assume that your starting page contains a button control named "button_top" and the page you are inserting also sports a control named "button_top". After the import operation, there will be two button controls associated with the "startingpage" that have the same name, "button_top." Since duplicate control names are now allowed within the context of the same page, this causes a problem.
To avoid this problem, the inserted page should have its own <form> tag with a unique name to prevent name collusions with input values in the page.