Using Web Settings with your DDS source

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 Window > Show view > Other > WebFacing > WebFacing Projects.

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.)

Table 1. Web Settings
DDS object Icon Available Web Settings
File level
Display Source Physical File
  • Key labels
Records
Standard Record
  • Key labels and key order
  • Disabled keys
  • Display size
  • Insert script
  • Application bridge
Subfile Control Record
Constants
Message Constant
  • Appearance
  • HTML overrides
  • Location
Date Constant
Time Constant
User Constant
System Constant
Input-capable fields (including fields with Both specified for usage)
Alphanumeric Field
  • Appearance
  • HTML overrides
  • Location
  • Option labels (only available if input field is specified with VALUES keyword)
Zoned Field
Date
Time
Timestamp
Float
Continued field
DBCS Just
DBCS Either
DBCS Open
DBCS Graphic
Output-only fields
Alphanumeric Field
  • Appearance
  • Dynamic key labels
  • HTML overrides
  • Hyperlink
  • Image
  • Location
Zoned Field
Date
Time
Timestamp
Float
DBCS Just
DBCS Either
DBCS Open
DBCS Graphic
Text constant
Hidden fields
Alphanumeric Field
  • Send to browser
Zoned Field
Date
Time
Timestamp
Float
DBCS Just
DBCS Either
DBCS Open
DBCS Graphic

Editing Web Settings for a DDS member

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:

  1. In the WebFacing perspective, expand WebFacing project > DDS.
  2. Right-click the DDS member you want to work with and select Open With > Remote Systems LPEX Editor.
  3. If prompted, sign on to the server. The file opens in the editor window.
  4. Click on a DDS object in the editor. The list of settings available for that object is displayed in the Web Settings view.
  5. Click on a setting in the list to edit it. The options for the Web Setting are displayed on the right side of the Web Settings view.
  6. If the Web Settings view is not open, open it by selecting Window > Show View > Other > WebFacing > Web Settings.
  7. To quickly navigate to specific objects, select Window > Show View > Outline to open the Outline view. As you click on objects in the Outline view, the focus will switch to that object in the editor window.

Web Settings descriptions

The Web Settings available for each DDS object vary depending on the object that you are working with. This section provides more details on each setting. When you use Web Settings for an object, special comments are added to your DDS source which later get processed by the WebFacing conversion. Web Setting comments begin with the characters *%%WB. The following is the syntax convention for Web Settings:
*%%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.

File-level Web Settings

The only file-level Web Setting is Key labels.

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.
Note: Function key labels cannot be overridden.

Syntax:

A*%%WB 9 FIL <key_label>["|"<key_label2>["|"<key_label3>[...]]]

Example:

A*%%WB 9 FIL 12=Cancel|03=Exit 

Record-level Web Settings

The following are the Web Setting categories available at the record level:
  • Display size
  • Insert script
  • Key labels
  • Key order
  • Disabled Keys
  • Application bridge
Display size

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
Insert script
Use the Insert script setting to customize the JSP files that are created for regular records or subfile control records. For example, if you have a subfile control record LISTCTL, the WebFacing conversion will create a corresponding JSP file LISTCTLJavaScript.jsp. The code that you add in the text area of the Insert script setting will be added to the file LISTCTLJavaScript.jsp when it is generated. This setting allows you to enter arbitrary JavaScript™ or JSP scriptlets into your converted JSP files. This can be used to initialize fields or perform any work required for the specific record format. For example, you could add code that sets a field's value if its initial value is null:
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}
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 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).

Note: There are several ways you can define the label for a function key in your WebFacing applications. If more than one label is defined for a key, WebFacing conversion and run-time uses a certain priority to determine which label will appear in the browser. Refer to Key Button Labels for the priority used for determining key labels.

Syntax:

A*%%WB 9 REC <key_label>["|"<key_label2>["|"<key_label3>[...]]]

Example:

A*%%WB 9 REC 2=enter|1=print
Key order

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.

Note: If you use CODE Designer to edit this particular Web Setting, the command and function keys will be separated. If you want to take advantage of being able to change the order of command and function keys, you should only use the Web Settings view to edit this Web Setting.

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.

Disabled keys

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.

On the user interface for Web Settings you can set the state of a key to one of three values:
  • Visible: Key label is visible and the related keyboard key is active.
  • Hidden: Key label is hidden but the related keyboard key is still active.
  • Disabled: Key label is hidden and the related keyboard key is disabled.

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

Defined keys: CF03 CA01 PRINT HELP
  1. Visible key order: CA01 HELP

    Disabled: CA01 CF03

    Results: (ordered visible keys: CA01 HELP; hidden but enabled keys: PRINT; disabled keys: CF03)

  2. Visible key order: none

    Disabled: CA01 CF03

    Results: (ordered visible keys: HELP PRINT; hidden but enabled keys: none; disabled keys: CA01 CF03)

  3. Visible key order: CA01 HELP

    Disabled: none

    Results: (ordered visible keys: CA01 HELP; hidden but enabled keys: CF03 PRINT; disabled keys: none)

  4. Visible key order: none

    Disabled: none

    Results: (ordered visible keys: CA01 CF03 HELP PRINT; hidden but enabled keys: none; disabled keys: none)

Application bridge

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

  • If you specify the Application bridge setting, all other settings on this record and on all the fields in this record will not be available and will be deleted if specified. If this is not desired, use Undo or Ctrl-Z to return to the original settings.
  • Field names in the record should not contain characters other than 'A'-'Z' and '0'-'9'.
  • The DATFMT and DATSEP keywords should not be used on a date hidden field, and the TIMFMT and TIMSEP keywords should not be on a time hidden field.

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

Field-level Web Settings

The following are the Web Setting categories available at the field level:
  • Appearance
  • Dynamic key labels
  • HTML overrides
  • Hyperlink
  • Image
  • Location
  • Option labels
  • Send to browser
Appearance

Options available for the Appearance and Text category are Visibility, Override style class, and Override field value:

  • Visibility allows you to make the field hidden by using the Hidden Web Setting. You can also use the Hide characters Web Setting to indicate a range of characters in your field that you do not want to display. For example, if your screen displays a menu of options for a user to choose from and each option is listed numerically (such as: 1. User tasks - 2. Office tasks), you might want to hide the first two characters so that only the text for the option is displayed. In an example like this, you would choose Hide characters and specify a range of From 1 To 2. Note that if you use the Hidden Web Setting, no other Web Setting is allowed on the same field.
  • Override style class allows you to specify a style sheet class to be used with the field. As an example, you may want to display all numeric data with a particular font or color and you have defined a style sheet class numeric for this purpose. If you had a customer number field in your program such as custno, you could select the Override style class check box and enter the name for your numeric style sheet class.
  • Override field value allows you to specify text that you want to display in place of the returned value for your field. For a constant field, the title of this check box changes to Override text and the field defaults to the text value of the constant.

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
Dynamic key labels

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.

To use this setting, choose the Dynamic key labels setting and select Use the field value as the label for the function key. In the list, choose the key that will be associated with the text from the output field. *AUTO can also be chosen from the list. *AUTO means that the field value is parsed at runtime to determine which command key to assign the label to. This allows multiple labels to be parsed.
Note: There are several ways you can define the label for a function key in your WebFacing applications. If more than one label is defined for a key, WebFacing conversion and run-time uses a certain priority to determine which label will appear in the browser. Refer to Key Button Labels for the priority used for determining key labels.
Note: Only a limited set of string patterns are currently supported by *AUTO. Assess whether *AUTO will work with your application based on the patterns listed in the prefix and separator table below and your knowledge of the strings for command key labels that are used in your application. The table identifies patterns by a prefix and a separator. For example, if the string F3=Exit is the output value and *AUTO is the value chosen in the list, the string Exit will be used for the command key label. That is, F is treated as the prefix, = is treated as the separator, and the text following the separator is used for the label. If you specify *AUTO, you can define multiple labels in the output field.
Prefix Separator
F =
FP =
CF =
CA =
PF =
Warnings
  • *AUTO can affect runtime performance. Use of *AUTO can be avoided by ensuring that there is a one-to-one mapping of output fields to command keys.
  • If you are not using *AUTO and you are using MSGFs for the text of output fields, the MSGF text should not include the key. For example, for Exit, the text in a MSGF should be Exit not F3=Exit.

Syntax:

A*%%WB 20 FLD (<key_number> | *AUTO)

Example:

A*%%WB 20 FLD F12
HTML overrides

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:

Before (%%WB 6)

<strong>64- prefix mandatory</strong>

Inside (%%WB 7)

value="64-"

After (%%WB 8)

<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>
Hyperlink

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.

Note: There are some conditions where Action hyperlinks that you create with Web Settings will not show up in a browser. This is done to prevent error conditions when the hyperlink does not apply to what is active or available on the browser. For example:
  • The hyperlink is in a record that is not currently the top window or on the top layer.
  • A function key that you have associated with the link is not currently active.
  • A referenced field that is part of the link is not in an active record or is not readable. For example, the record is protected by other records which use the PROTECT keyword.
Use DDS settings

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
Go to URL

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.

If there is a field value in your DDS that you would like to be part of the URL, click the button on the URL field and select the record, field, and attribute you want to use. For example, if you wanted to add parameters to the URL http://mysite.com/mywebapp/servlet/MyServlet and the servlet was expecting arguments for variables called parm1 and parm2, you could use Insert field value to help construct the URL. In this example, your final URL might look like http://mysite.com/mywebapp/servlet/MyServlet?parm1=&{FIELD1.INITIALVALUE}&parm2=&{FIELD2.INITIALVALUE} where &{FIELD1.INITIALVALUE} and &{FIELD2.INITIALVALUE} are parameters you added and that represent values that change at runtime.
Note: If you would like to use a field value from a different record format to be part of the URL for your hyperlink field, you must ensure that the field will be available on the Web page when the hyperlink is displayed. Fields that are in different record formats can be identified in the Insert field attribute dialog because they include the record format name, for example, &{RECORD2.FIELD1.INITIALVALUE}. If both record formats are not available on the Web page when the hyperlink is displayed, an exception will occur when the hyperlink is selected. For more information on using field replacement variables, see Specifying field replacement variables.

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}
Perform actions
The Perform actions setting creates a link that when clicked can position the cursor to a field, perform a submit, or a combination of the two. The Position cursor to field and More actions functions both have values that you can specify.
Position cursor to field
When the link is clicked, the runtime value for cursor location that is returned to your application will be the location of the field you specify here. You can select a field from the drop down list or manually enter the name of a field. If you do not select Position cursor to field, the cursor is positioned to the field that was last selected by the Web user. This cursor value does not refer to the cursor as it is displayed by the browser, it refers to the WebFacing runtime's value for current cursor location of fields in the DDS record. If you want to assign a value to the field where the cursor is positioned, choose a field or select the Set field value to check box and enter a value in the text area. Some of these settings accept field values as input. For more information on using field replacement variables, see Specifying field replacement variables.

Syntax:

A*%%WB 12 FLD 5 fld=<field>"|"value=<value>
More actions

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
Call JavaScript

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.

Syntax (Submit function key):
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>
Note: JavaScript hyperlink is deprecated, and becomes Call JavaScript.

Image

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.

If there are fields in your program that return values that can be used as part of the image file name, or the full URL to an image file, these values can be added to the File name field by clicking Insert field attribute and selecting a field from theField. For example, if you had &{FIELD.INITIALVALUE} that returned the value bicycle1, you could easily refer to a graphic bicycle1.gif. In this example, first select the Dynamic radio button and then populate the File name field using Insert field attribute and then add the .gif extension. Files that you identify by using a field attribute must be manually copied over to the ..\WebContent\images\generated\ directory.
Note: The only field attribute allowed for this Web Setting is Initial Value. This is because images must be fully resolved at the time a Web page is first loaded.
For more information on using field replacement variables, see Specifying field replacement variables.

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
Location

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.

  • Change position allows you to indicate the row and column in the HTML table that will be the starting position for your field.
  • Change span allows you to indicate the number of rows and columns in the HTML table that will be given to your field. A potential use for Change span would be using a graphic in place of the text values that your program originally used to populate the field. For example, the original program may have required 7 columns for text for the field but the graphic that you want to use only requires 2 columns.

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.

An additional option for the Location setting is CSS position. The Cascading Style Sheet - Positioning setting enables you to place fields anywhere on a Web page, without restrictions.
  • Row allows you to specify the row value for the field. It must be a positive integer greater than or equal to 1.
  • Column allows you to specify the column value for the field. It must be a positive integer greater than or equal to 1.
  • Offset allows you to specify the number of pixels the field is adjusted to, relative to the row or column value. This number can be 0, or a positive or negative integer.
  • Disable tabbing allows you to indicate whether or not the field can be tabbed to after it is moved. If you select Disable tabbing, the user cannot tab to this field. Otherwise, the field remains in the same tab order it was in before it was moved.

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>
Note: The pixel offset must be preceded by + or -. The value for disable_tabbing must be either true or false.

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
Option Labels

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
Send to browser

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

Specifying field replacement variables

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:

&{FIELD.CURRENTVALUE}
This is the current value of an HTML field object for an input-capable field in the current record, which can be modified by user input in the browser, or is hidden but uses the Send to browser Web Setting.

The deprecated variable is &{FIELD.value}.

&{FIELD.INITIALVALUE}
This is the initial value from the WebFacing run-time for input or output fields in the current record.

The deprecated variable is &{FIELD.value}.

&{RECORD.FIELD.CURRENTVALUE}
This is the current value of an HTML field object for an input-capable field in the specified record, which can be modified by user input in the browser.

The deprecated variable is &{RECORD.FIELD.value}.

&{RECORD.FIELD.INITIALVALUE}
This is the initial value from the WebFacing run-time for input or output fields in the specified record.

The deprecated variable is &{RECORD.FIELD.value}.

&{FIELD.REF}
This is an HTML field object reference, for example, document.SCREEN.l1_REC1$FIELD1. This is only for input fields or fields that are hidden but use the Send to browser Web Setting. For output-only fields, use &{FIELD.ID}.

The deprecated variable is &{FIELD}.

&{FIELD.ID}
This is an HTML field ID, for example, l1_REC1$FIELD1. This is for input and output fields.

The deprecated variable is &{FIELD}.

&{RECORD.FIELD.REF}
This is an HTML field object reference in the specified record. This is only for input fields. For output-only fields, use &{RECORD.FIELD.ID}.

The deprecated variable is &{RECORD.FIELD}.

&{RECORD.FIELD.ID}
This is an HTML field ID in the specified record. This is for input and output fields.

The deprecated variable is &{RECORD.FIELD}.

&{WEBFACINGFORMID}
This is the value for the ID attribute of the HTML form where all of the fields reside. This can be used for customized JavaScript.

Using special values

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:

&{*SYSNAME}
This value inserts the name of the system on which the application is running. It can only be used on the SYSNAME field.

The deprecated value is &SystemName.

&{*USER}
This value inserts the user ID of the current user. It can only be used on the USER field.

The deprecated value is &UserID.

&{*DATE}
This value inserts the current system date. It can only be used on the DATE field.

The deprecated value is &Date.

&{*TIME}
This value inserts the current system time. It can only be used on the TIME field.

The deprecated value is &Time.


Feedback