Portlet Factory, Version 6.1.2
Button builder inputs
This topic describes the inputs for the Button builder.
General inputs
Table 1. General inputs Input name Description Name Name for this builder call. The WebSphere Portlet Factory Designer displays this name in the builder call list. Page Location Page or pages on which this builder call acts. Label Enter the text to be displayed on this button. Action Type Defines the behavior of the action. Choose an action type based on the action that processes the onClick event and if you want to process any form inputs as part of that action.
- Submit form and invoke action
- Choose this option if the specified action is a method in the model or linked Java™ object and that method processes the inputs to the form on which the button resides.
- Submit form to URL
- Choose this option if the specified action is a URL outside of the IBM® WebSphere Portlet Factory runtime that is to process the inputs to a form. The specified URL receives the form input values as name and value pairs appended to the URL.
- Link to an action
- Choose this option if the specified action is a method in the model or linked Java object (including service calls). This option acts as a simple link, transferring control directly to the specified URL. The specified action cannot process any form inputs.
- Link to a URL
- Choose this option to navigate to a URL that is not supported in WebSphere Portlet Factory. The URL cannot process any form inputs.
- Run a script
- Choose this option to run some client-side JavaScript™ when the user clicks the button. The script cannot process any form inputs.
Action Specify the model action or external URL to execute when the user clicks the button. Script to Execute Applies only if you selected Run a script as the value for Action Type. JavaScript to execute when the user clicks the button. Form inputs, if any, are not submitted to a script. Note: Do not use comments in the script that you specify. The script you specify is added as one line, so any code following comments is ignored.
Arguments
Table 2. Arguments inputs Input name Description Input Mappings You can pass arguments to the specified action by adding argument names and the value to be passed to it. Use the reference chooser to specify input values or values returned by methods or service calls as the value to be passed to an argument for the specified action.
Table 3. Post-action behavior inputs Input name Description Show Advanced Options Set to display extra options in the Post-Action Behavior input. Clear to display only Default and Refresh specified page location after running action. Post-Action Behavior Select what happens after the action launched by the button completes.
- Default
- Typically this displays the output generated by the action. An exception is when the action is run from inside a container that specifies that the outermost page gets rendered after the action runs. In the exception case, default does not display the output, but refreshes the outermost page.
- Refresh specified page location after running action
- The outermost page is not refreshed. Instead, new HTML for the specified region is recalculated after the action runs, and this HTML is sent to the client where it replaces the existing HTML. The Location to Refresh input is made available to specify the area on the page to be displayed.
If Replace "id" Matches is checked, the HTML produced by the action is examined for elements that have ID attribute values. If ID attribute values are found, the corresponding elements in the page have their HTML replaced.
Note: If Ajax is disabled, the default post-action behavior is used without loss of functionality. Ajax enablement is controlled through the Global Ajax Enablement builder and profiling rather than changing inputs in a large number of builders.
- Replace specified location with action results
Available if Show Advanced Options is set. This is good for ToolTips, incremental validation, and other simple information calculated on the server. The Location to Refresh input is made available to specify the area on the page to be displayed.
Note: If Ajax is disabled, the default post-action behavior is used without loss of functionality. Ajax enablement is controlled through the Global Ajax Enablement builder and profiling rather than changing inputs in a large number of builders.
- Evaluate action results as JavaScript
- Available if Show Advanced Options is set. Run the main action, and evaluate what it returns as JavaScript.
- Always reload top-most page after running action
- Available if Show Advanced Options is set. This is very similar to default, but overrides behavior that prevents the topmost page from refreshing. This option can be necessary if portal event and render phases need to be carried out to enable portlet-to-portlet communication to function properly.
- Show action results "stand-alone": display no containing pages
- Available if Show Advanced Options is set. This option is similar to default, but it ensures that even if the model is running in a portal or model container, the action only returns the results of the specified action, not the containing portal or other surrounding pages. This option is ideal for lower-level Ajax or related functionality, for example, pop-ups, computed images, or Excel export.
Execute Embedded Scripts This input is available if the Post-Action Behavior input is set to Refresh specified page after running action. Set this input to execute any JavaScript present in the page that is being refreshed. Any script specified either by <script src="name" /> or as text inside a <script> section is executed.
Location to Refresh This input is available if either Refresh specified page location after running action or Replace specified location with action results is set for the Post-Action Behavior input. Under Page Location, in Location Technique, set one of the following to determine the area on the page to be displayed.
- On Named Tag
- Specify both of the following inputs:
- Page
- Select the name of the page.
- Tag
- Select the location tag for the page.
- Relative to Named Tag
- In addition to Page and Tag, you can specify the following inputs:
- Placement
- Can be one of the following inputs:
- Replace Node
- Output replaces the element specified in the Tag input.
- Before After Inside-Top Inside-Bottom TableWrapAbove TableWrapBelow TableWrapLeft TableWrapRight
- Output gets inserted as specified relative to the location indicated by the Tag input. These are the standard techniques for locating builder output on pages.
- New Tag Name
- Name assigned to the inserted output.
- Avanced
- In the text area, paste your code to be run.
Advanced
Table 4. Advanced inputs Input name Description Target The window or frame which displays the results of the action. If you do not set this value, the current window or frame is the target. Valid entries include the following:
- _self
- Display results in the frame containing the form. If target is not specified, _self is the default.
- _blank
- Display results in a new browser window.
- _parent
- Display results in the frameset above the frame containing the form.
- _top
- Display results the topmost frameset.
You can also specify the name of a frame in the current frameset.
Note: All of these targets are relative to the form being processed, not to the builder itself.
Rendering mode
- Normal
- If you know that the specified action returns a specific page, set Normal.
- If you do not know the specific page that gets returned, set Render outermost page after running action. The Preserve Page input becomes available.
For example, use this setting when creating a builder.
Break Containment Set this input to replace the contents of the target window with the contents of the URL returned by the action. Clear this input to preserve the contents of the target window. Preserve Page Available if you set Render outermost page after running action. Set to save the contents of the page. Clear to discard the page. Form Name If the image button is in one form and the inputs to be submitted are in another, enter the name of the form whose inputs you want to submit.
HTML Attributes
Table 5. HTML Attributes inputs Input name Description Class Click the chooser and either navigate to and select the Java class to use or click Java > replace with Java expression to specify your own class. Style Click the chooser and either navigate to and select the CSS file to use or click Java > replace with Java expression to specify your own style. Parent topic: Button builder
Library | Support |