An advantage to customizing your pages with Web Settings is that the instructions for the customizations are embedded as comments in your DDS source; since Web Settings become part of your source, changes that you make are not lost if you later reconvert a WebFacing project. Changes made directly to a generated JSP file are lost, however, when you reconvert your project.
If you add or change the Web Settings for a project that has already been converted, reconvert your project to make the changes part of your WebFacing application. Alternatively, you can reconvert just the DDS members that you changed. To reconvert specific members, open the WebFacing perspective, click the WebFacing Projects tab, expand the DDS folder, right-click the member that you have changed and select Convert. If the WebFacing Projects view is not open, select .
If more than one Web Setting of the same type is specified on a single field, record, or file, then the behavior is undefined. (In other words, there is no guarantee as to which of those duplicate Web Settings will take effect.)
DDS object | Icon | Available Web Settings |
---|---|---|
File level | ||
Display Source Physical File | ![]() |
|
Records | ||
Standard Record | ![]() |
|
Subfile Control Record | ![]() |
|
Constants | ||
Message Constant | ![]() |
|
Date Constant | ![]() |
|
Time Constant | ![]() |
|
User Constant | ![]() |
|
System Constant | ![]() |
|
Input-capable fields (including fields with Both specified for usage) | ||
Alphanumeric Field | ![]() |
|
Zoned Field | ![]() |
|
Date | ![]() |
|
Time | ![]() |
|
Timestamp | ![]() |
|
Float | ![]() |
|
Continued field | ![]() |
|
DBCS Just | ![]() |
|
DBCS Either | ![]() |
|
DBCS Open | ![]() |
|
DBCS Graphic | ![]() |
|
Output-only fields | ||
Alphanumeric Field | ![]() |
|
Zoned Field | ![]() |
|
Date | ![]() |
|
Time | ![]() |
|
Timestamp | ![]() |
|
Float | ![]() |
|
DBCS Just | ![]() |
|
DBCS Either | ![]() |
|
DBCS Open | ![]() |
|
DBCS Graphic | ![]() |
|
Text constant | ![]() |
|
Hidden fields | ||
Alphanumeric Field | ![]() |
|
Zoned Field | ![]() |
|
Date | ![]() |
|
Time | ![]() |
|
Timestamp | ![]() |
|
Float | ![]() |
|
DBCS Just | ![]() |
|
DBCS Either | ![]() |
|
DBCS Open | ![]() |
|
DBCS Graphic | ![]() |
When you first open the WebFacing perspective, the Web Settings view is displayed by default. The view will remain empty until you open a DSPF DDS source member in the LPEX Editor. To edit Web Settings for a DDS member:
*%%WB <number> <level>where <number> is the number of the Web Setting and <level> is its level ({FIL|REC|FLD}). You can span Web Settings over multiple lines by putting + as the last non-blank character on the line and starting the next line with *%%WB +.
The following sections describe the Web Settings by file, record, and field level, and include the syntax of the comments added to your DDS source for each setting. Some Web Settings use a different syntax prior to WebSphere® Development Studio Client for iSeries® Version 6.0. Although the syntax for some of the Web Settings is obsolete, it is converted to the updated syntax during WebFacing conversion. Deprecated syntax is shown if applicable for each Web Setting.
The only file-level Web Setting is Key labels.
For function or command keys in your DDS source, you can specify the text labels to be used in your Web pages to represent the keys. To change a label, select a function or command key from the Key labels list, double-click the New Label field, and enter the new text for the key. To remove a label that you have defined, double-click the New Label field and delete the text.
You can also select the appropriate row and use the Edit Label or Delete key to perform these functions.Syntax:
A*%%WB 9 FIL <key_label>["|"<key_label2>["|"<key_label3>[...]]]
Example:
A*%%WB 9 FIL 12=Cancel|03=Exit
The Display size setting is available if a secondary display size has been selected for your display file. Secondary display sizes can be specified using the file-level DSPSIZ keyword. Use the Display size Web Setting to change the size of the HTML table that will be used to display your application in a browser. This Web Setting only applies to records that have a conditioned DSPMOD keyword. These records could be displayed in either the primary or secondary display size depending on the value of the condition at run time, however, WebFacing conversion only targets one display size. If you want the application to show this record in the secondary display size rather than the default primary display size, you need to specify this Web Setting.
Syntax:
A*%%WB 10 REC
Example:
A*%%WB 10 REC
if(&{CID.INITIALVALUE} == "") { &{CID.REF}.value = "0001"; }In this example, the code &{CID.INITIALVALUE} refers to a field CID that was selected using the Insert field attribute button. For more information on using field replacement variables, see Specifying field replacement variables. Other examples would be JSP code that determines the IP address of a WebFacing user or JavaScript that displays the time of day of the user's system. You can use Insert script along with the Send to browser setting. For example, you can use values determined by your scripts to populate hidden fields that you have set with the Send to browser setting. If there is an existing field in your DDS that you want to use as part of your script, add it to your script using the Insert field attribute button. For example, you can select an H or hidden field and use it in your script so that a value can be assigned to it.
Syntax:
A*%%WB 18 REC 1 <script>
deprecated:
A*%%WB 18 REC <script>
For Insert script, there are two deprecated forms of replacement variables:
&SFLREC{FIELD} which becomes &{SFLREC.FIELD.REF}
and
&{FIELD} which becomes &{FIELD.REF}
For example, the old Insert script (REC):
A*%%WB 18 REC &{FIELD1}.value=1;&RECORD3{FIELD1}.value=4
becomes the new Insert script (REC 1):
A*%%WB 18 REC 1 &{FIELD1.REF}.value=1;&{RECORD3.FIELD1.REF}.value=4
Example:
A*%%WB 18 REC 1 &{CUSTCTL.field1.CURRENTVALUE}
For function or command keys in your DDS source, you can specify the text labels to be used in your Web pages to represent the keys. To change a label, select a key from the Key labels and key order list, double-click the New Label field, and enter the text you would prefer for the key. The New Label value defaults to the File level key labels Web Setting if one is defined. To remove a label that you have defined, double-click the New Label field and delete the text. You can also select the appropriate row and use the Edit Label or Delete key to perform these functions. The Default button removes all related Web Settings (like Key labels, Key order, and Disabled keys).
Syntax:
A*%%WB 9 REC <key_label>["|"<key_label2>["|"<key_label3>[...]]]
Example:
A*%%WB 9 REC 2=enter|1=print
For function or command keys in your DDS source, you can specify whether or not a key label is hidden on your Web pages and the order in which the keys are displayed.
To hide a key, select the key from the Key labels and key order list and select Hidden from the drop down list in the State column. This removes the key from the list of buttons on the Web page but does not disable the corresponding key on the keyboard.
To disable a key, select the key from the Key labels and key order list and delect Disabled from the drop down list in the State column. This removes the key from the list of buttons on the Web page and disables the corresponding key on the keyboard.
If more than one key is available in the Key labels and key order list, the order in which it is displayed can be changed by selecting the key and clicking the Move Up or Move Down buttons. The Default button restores the keys to their original order.
Syntax:
A*%%WB 11 REC <aid_key> [<aid_key2> [<aid_key3> [...]]]
where <aid_key> = CAnn | CFnn | SFLFOLD[(CAnn|CFnn)] | SFLDROP[(CAnn|CFnn)].
Example:
A*%%WB 11 REC CA02 CF14 SFLFOLD(CF10) SFLDROP(CA09)
If SFLFOLD or SFLDROP is specified with no aid key, for example:
A*%%WB 11 REC CA02 CF14 SFLFOLD SFLDROP(CA09)
the Web Setting will be updated to the following:
A*%%WB 11 REC CA02 CF14 SFLFOLD(CF10) SFLDROP(CA09)
with the SFLFOLD keyword specified using the command function key 10.
This Web Setting works in conjunction with key labels and key order. It allows you to disable an active aid key (command or function key) on the keyboard as opposed to just hiding its label from the Web user interface.
Keys are sequenced according to the Key order Web Setting. If a Key order Web Setting is not specified, the sequence is determined according to the numeric order for command keys and alphabetic order for function keys, with command keys always coming before function keys. If a key is defined in both the visible Key order Web Setting (A*%%WB 11) and Disabled key Web Setting (A*%%WB 41), the visible sequence takes precedence.
Syntax
A*%%WB 41 REC <aid_key> [<aid_key2> [<aid_key3> [...]]]
Examples
Visible key order: CA01 HELP
Disabled: CA01 CF03
Results: (ordered visible keys: CA01 HELP; hidden but enabled keys: PRINT; disabled keys: CF03)
Visible key order: none
Disabled: CA01 CF03
Results: (ordered visible keys: HELP PRINT; hidden but enabled keys: none; disabled keys: CA01 CF03)
Visible key order: CA01 HELP
Disabled: none
Results: (ordered visible keys: CA01 HELP; hidden but enabled keys: CF03 PRINT; disabled keys: none)
Visible key order: none
Disabled: none
Results: (ordered visible keys: CA01 CF03 HELP PRINT; hidden but enabled keys: none; disabled keys: none)
To interoperate with another Web application, choose the Application bridge setting and select Use this record for Application bridge parameters. Note that this setting is only available for records which only have hidden fields (usage H), or which have no fields.
In the entry field, enter the URL of the target application. This URL follows the format "/appContextRoot/appEntryPoint" where appContextRoot is the context root for the Web application you want to interoperate with and appEntryPoint is the entry point for that Web application. Refer to Using the WebFacing application bridge to interoperate with other Web applications for details about how to interoperate with another Web application.
Notes
Syntax
A*%%WB 42 REC /appContextRoot/appEntryPoint
Example
To interoperate with a Web application where the context root is webApp and the entry point is ProcessOrder:
A*%%WB 42 REC /webApp/ProcessOrder
Options available for the Appearance and Text category are Visibility, Override style class, and Override field value:
Syntax (Hidden):
A*%%WB 4 FLD
Syntax (Hide characters):
A*%%WB 5 FLD <from> <to>
Syntax (Override style class):
A*%%WB 1 FLD <style> <field>
Syntax (Override field value):
A*%%WB 3 FLD <length>"|"<text>
Example (Hidden):
A*%%WB 4 FLD
Example (Hide characters):
A*%%WB 5 FLD 1 12
Example (Override style class):
A*%%WB 1 FLD wf_default wf_field
Example (Override field value):
A*%%WB 3 FLD 10|OOOOOOOOOO
The Dynamic key labels setting can be used to determine the text label of a command key at runtime. This setting is only available for output fields. With this setting, a command key is associated with the output field and text for the command key is determined by the runtime value of the field. An example use is if your application is to support more than one language and you want the command key text to appear in the user's native language. One way of doing this is to have a MSGF per language that contains the text strings that your application uses and put each MSGF in a language specific library. If the output field's value is read from the MSGF, you could change the language of the text displayed in the field by putting the library that contains the MSFG for your user's language higher in the library list in the user's profile. Subsequently, the command key label would be displayed in their language.
Prefix | Separator |
---|---|
F | = |
FP | = |
CF | = |
CA | = |
PF | = |
Syntax:
A*%%WB 20 FLD (<key_number> | *AUTO)
Example:
A*%%WB 20 FLD F12
HTML overrides allows you to override the generated HTML by replacing it with user-defined HTML or inserting HTML along with the generated HTML.
Click the Program-defined radio button to specify that the value of the field itself should be used as the generated HTML. Use this setting if you want the application program to compute the HTML for this field rather than using something generated by WebFacing conversion.
Click the User-defined radio button to specify HTML text or tags that can be displayed in place of or with the value for your field. In the entry area, enter the HTML tags you would like to use. The default value for this Web Setting is the script representing the value of the field or the text value of the constant. If you want to use the value for your field as part of the HTML, click the button Insert field attribute. For more information on using field replacement variables, see Specifying field replacement variables. One example of how you could use this option would be if you wanted the value for your field to be displayed with a bold font. To do this, use the <B> tag with the &{FIELD.INITIALVALUE} text. With this example, edit the entry area so that it displays <B>&{FIELD.INITIALVALUE}</B>. If the code for &{FIELD.INITIALVALUE} is not there by default, it can be added by clicking the Insert field attribute button. You can also add special values, such as the system date or time, to your user-defined HTML. See Using special values for more information on using special values in your HTML.
Click the Insert radio button to customize your fields by including additional HTML. HTML can optionally be added Before, Inside, and After the HTML tag that is automatically generated for the field. As an example, you might have an input field for employee numbers and at your company all employee numbers are prefixed with 64-. You could make the field easier to use by adding some HTML such as:
<strong>64- prefix mandatory</strong>
value="64-"
<a href="help.htm">Click here for more information on this field</a>
In this example, the HTML Before the field provides some information about the field and uses the <strong> tag so that the information is emphasized with a bold font. Since the HTML generated by conversion uses the <input> tag for input fields, Inside the <input> tag we could add the HTML attribute value="64-" so that the field will be pre-populated with the employee number prefix and your users will not be required to enter it. After the field is the HTML for a link that users can click to get more information about the field.
Ensure that you thoroughly test pages that you are altering with the Insert HTML setting. Changes that you make can conflict with the HTML that is generated by the WebFacing conversion. One way to work around this would be to convert your program without using Web Settings, look at the .html or .jsp source that is generated to see what changes can safely be made with Web Settings, apply Web Settings and then re-convert.
Syntax (Program-defined):
A*%%WB 16 FLD
Syntax (User-defined):
A*%%WB 17 FLD 1 <html>
A*%%WB 17 FLD 1 &{FIELD.INITIALVALUE}
If encountered, the deprecated %FieldValue is mapped to the newer form of &{FIELD.INITIALVALUE}:
A*%%WB 17 FLD <html>
A*%%WB 17 FLD &FieldValue
Syntax (Insert before):
A*%%WB 6 FLD <html>
Syntax (Insert inside):
A*%%WB 7 FLD <html>
Syntax (Insert after):
A*%%WB 8 FLD <html>
Example (Program-defined):
A*%%WB 16 FLD
Example (User-defined):
A*%%WB 17 FLD 1 <BOLD>&{PARTSFL.STQTY.CURRENTVALUE}</BOLD>
Example (Insert before):
A*%%WB 6 FLD <strong>64- prefix mandatory</strong>
Example (Insert inside):
A*%%WB 7 FLD value="64-"
Example (Insert after):
A*%%WB 8 FLD <a href="help.htm">Click here for more information on this field.</a>
Use the Hyperlink setting to display your field as a hyperlink. You can format your hyperlink according to the DDS settings or browser settings, and link to a static page or perform actions. If you want to override the browser's settings for hyperlink appearance, select the Use DDS settings check box. If you use the Hyperlink setting along with the Image setting, your field can be displayed as a graphic that also acts as a hyperlink. Some of these settings accept field values as input. For more information on using field replacement variables, see Specifying field replacement variables.
Most browsers follow a convention for the color and appearance of hyperlinks on Web pages or have settings for hyperlink appearance that users can change. For example, unvisited links may be displayed in blue text and visited links may be displayed in purple text. If you want the browser to display the hyperlink with the same appearance as is used for the field in your DDS, select the Use DDS settings radio button.
Syntax (Use DDS settings):
A*%%WB 12 FLD 3 <hyperlink_type> <hyperlink_details> 1
Syntax (Use browser settings):
A*%%WB 12 FLD 3 <hyperlink_type> <hyperlink_details>
Example:
A*%%WB 12 FLD 3 http://www.ibm.com| 1
If there is a specific URL that you want to be displayed for a field, select Go to URL. The output value of your field will be the text that is displayed as a hyperlink. The location loaded by the browser when a user clicks the link is the value that is entered in the URL field. If you want the link to launch a separate browser window when it is clicked, enter a name for the window in the Target field. If you leave the Target field blank or enter *SAME, the link will open in the current browser window.
If you are working with a WebFacing portlet project, you can specify *PORTLET in the Target field to open the link within the portlet.
Syntax:
A*%%WB 12 FLD 3 <url>"|"<target>
deprecated:
A*%%WB 12 FLD 1 <url>"|"<target>
Example:
A*%%WB 12 FLD 3 http://server/somepath?p2=&{FIELD2.INITIALVALUE}&p1=&{FIELD1.INITIALVALUE+ A*%%WB +}&p3=&{FIELD1.INITIALVALUE}
deprecated:
A*%%WB 12 FLD 1 http://server/somepath?p2=&{FIELD2}&p1=&{FIELD1}&p3=&{FIELD1}
Syntax:
A*%%WB 12 FLD 5 fld=<field>"|"value=<value>
If the More actions check box is selected, you can choose a Function key or JavaScript function call submit action for the hyperlink. For example, from the Submit function key drop down list, you can choose ENTER, LOGOFF, or a function key that you have defined in your DDS. If there is a function key from another DDS record that you would like to use, manually enter the value for the function key. When a user clicks a link that you have created for a function key, the program will execute that function. In the JavaScript function call field, you can enter the name of a JavaScript function that you want to be executed when the link is clicked. The function can be one that you have entered using the Call JavaScript Web Setting, a function that you have defined in an external JavaScript file, or a function that is included with WebFacing in the file webface.js. If you create your own external JavaScript files, put them in the usr directory of your WebFacing project. This directory is located in the path <project name>\WebContent\ClientScript\usr. Any scripts that you put in this directory are available to your WebFacing application at runtime.
You can combine the Position cursor to field option with the Submit function key option. Do this if you want to set the value for a specific field and submit that value back to your program. To do this, select the Position cursor to field check box, choose a field from the drop down list (or enter a field) , select the More actions checkbox, select the Submit function key radio button, and choose ENTER from the drop down list. For information about the entry format to use for Position cursor to field and the Submit function key field, see the section of this document Position cursor to the field.
Syntax:
A*%%WB 12 FLD 4 fld=<field>"|"value=<value>"|"func=<function_key>
deprecated:
A*%%WB 12 FLD 2 fld=<field>"|"value=<value>
Example:
A*%%WB 12 FLD 4 fld=&{FIELD3.REF}|value=1|func=ENTER
deprecated:
A*%%WB 12 FLD 2 fld=FIELD3|value=1
Enter the name of a JavaScript function that you want to be called when the link is clicked. For example, enter myFunction() . The function can be one that you have entered using the Insert script Web Setting, a function that you have defined in an external JavaScript file, or a function that is included with WebFacing in the file webface.js. If you create your own external JavaScript files, put them in the usr directory of your WebFacing project. This directory is located in the path <project name>\WebContent\ClientScript\usr. Any scripts that you put in this directory are available to your WebFacing application at runtime. If you have a short inline JavaScript function, you can also enter the entire function in the Call JavaScript field.
A*%%WB 12 FLD 6 <function_key>Syntax (Call JavaScript):
A*%%WB 12 FLD 7 <javascript>Syntax (Position cursor to a specific field with data and submit JavaScript):
A*%%WB 12 FLD 8 fld=<field>"|"value=<value>"|"func=<javascript>Syntax (JavaScript hyperlink):
A*%%WB 12 FLD 9 <javascript>
Use the Image setting if you want to display an image in place of your field. An example use for this setting would be a product database that includes images of inventoried items.
Populate the File name field with the complete path to an image file on your workstation or with the complete URL to an image file (e.g. http://www.ibm.com/image.gif). The File name field can be populated by entering a value directly or by using the Browse button to locate a local file. Local images that you specify will be copied to the ..\WebContent\images\generated\ directory of your WebFacing project during the WebFacing conversion. The images in this directory are later published to the server when you deploy your project with the Export wizard.
Width and Height can be used if you know the dimensions of an image. Adding width and height information can sometimes decrease the time required to render Web pages that contain images.
The Alternative text field allows you to specify the alternative text for the image.
Syntax:
A*%%WB 13 FLD 1 <width>"|"<height>"|"<graphic>"|"<alternative text>
deprecated:
A*%%WB 13 FLD <width>"|"<height>"|"<graphic>
Example:
A*%%WB 13 FLD 1 15|34|graphic.gif A*%%WB 13 FLD 1 15|34|graphic.gif|IBM logo
A*%%WB 13 FLD 1 3|2|&{FIELD1.INITIALVALUE}.gif
deprecated:
A*%%WB 13 FLD 15|34|graphic.gif
A*%%WB 13 FLD 3|2|&{FIELD1}.gif
Options available for the Location setting are Change span and Change position. After your DDS source has been converted with the WebFacing Tool, your application is positioned on a Web page using an HTML table. The HTML table has the same number of rows and columns as your DDS screen -- that is, 24 by 80 or 27 by 132. With Location settings, you can change how your fields will be positioned on the HTML table after your source is converted.
The editor window shows the row and column layout for your DDS source. Use this view to get an idea of how your fields will be positioned relative to each other if you make changes with Change position and Change span.
Syntax (Change position):
A*%%WB 2 FLD <row_number> <column_number>
Syntax (Change span):
A*%%WB 15 FLD <row_number> <column_number>
Syntax (CSS position):
A*%%WB 21 FLD <row_number> +/-<pixel_offset> | <column_number> +/-<pixel_offset> | <disable_tabbing>
Example (Change position):
A*%%WB 2 FLD 14 3
Example (Change span):
A*%%WB 15 FLD 1 1
Example (CSS position)
To move an input field to row 30, column 20 (with no offset for either) and allow tabbing:
A*%%WB 21 FLD 30 +0 | 20 +0 | false
To disable tabbing and move an input field to row 40 and column 10, with an offset of 20 pixels down and 5 pixels left, respectively:
A*%%WB 21 FLD 40 +20 | 10 -5 | true
The Option Labels setting is available for input fields that are specified with the VALUES keyword. Fields that are specified with the VALUES keyword are displayed on Web pages as a series of radio buttons. The options displayed in the selection box are the values given as parameters to the VALUES keyword in your DDS source.
This Web Setting allows you to change the label or text that is displayed to the user. For example, if one of the VALUES parameters that your program is expecting is "item8", you might change the text that is displayed in a browser to something more descriptive such as "8 gauge wire". While the text displayed to the user would be "8 gauge wire" the value returned to your program would be the same "item8" that the program would expect.
To use this Web Setting, double-click the Option Label field and enter the text that you want.
Syntax:
A*%%WB 14 FLD <value>=<label>["|"<value2>=<label2>["|"<value3>=<label3>[...]]]
Example:
Using numeric values:
A*%%WB 14 FLD 0=value 0|1=value 1
Using text values:
A*%%WB 14 FLD 'value0'=value 0|'value1'=value 1
The Send to browser setting can be used for H or hidden DDS fields. This setting modifies the generated JSP files for your records. For example, if you have an H field in a record called LISTCTL, when this setting is used, an HTML hidden input form element will be generated in the JSP file LISTCTL.jsp. Hidden input form elements begin with the HTML code <INPUT TYPE="hidden" . Using Send to browser enables an H field to become part of the browser environment and for values to be assigned to it based on that environment. For example, the IP address of a user that is determined by a script you added using the Insert into script setting could be used to populate the hidden field.
Syntax:
A*%%WB 19 FLD
Example:
A*%%WB 19 FLD
Field replacement variables are allowed in the Insert HTML, User-defined HTML, Image, Insert script, Go to URL, Position cursor to field, and Call JavaScript Web Settings. Here are the possible replacement variables, including the deprecated (but supported) variables for each:
The deprecated variable is &{FIELD.value}.
The deprecated variable is &{FIELD.value}.
The deprecated variable is &{RECORD.FIELD.value}.
The deprecated variable is &{RECORD.FIELD.value}.
The deprecated variable is &{FIELD}.
The deprecated variable is &{FIELD}.
The deprecated variable is &{RECORD.FIELD}.
The deprecated variable is &{RECORD.FIELD}.
You can use special values when you insert user-defined HTML using the User-defined Web Setting in HTML overrides. The following values can be used in the context of the User-defined Web Setting on the corresponding fields in your DDS:
The deprecated value is &SystemName.
The deprecated value is &UserID.
The deprecated value is &Date.
The deprecated value is &Time.