How to Add a Form to a Page

9-8 Web User Interface Developers Guide for Oracle Application Development Framework To add an inputText component: 1. In the Component Palette, from the Common Components panel, drag and drop an Input Text onto the page. 2. In the Property Inspector, expand the Common section and set the following: ■ Label : Enter a value to specify the text to be used as the label. If the text to be used is stored in a resource bundle, use the dropdown list to select Select Text Resource. Use the Select Text Resource dialog either to search for appropriate text in an existing bundle, or to create a new entry in an existing bundle. For more information about using resource bundles, see Chapter 21, Internationalizing and Localizing Pages. ■ Value : Specify the value of the component. If the EL binding for a value points to a bean property with a get method but no set method, and this is a component whose value can be edited, then the component will be rendered in read-only mode. 3. Expand the Appearance section, and set the following: ■ Columns : Specify the size of the text control by entering the maximum number of characters that can be entered into the field. ■ Rows : Specify the height of the text control by entering the number of rows to be shown. The default value is 1, which generates a one-row input field. The number of rows is estimated based on the default font size of the browser. If set to more than 1, you must also set the wrap attribute. ■ Secret : Specify this boolean value that applies only to single-line text controls. When set to true, the secret attribute hides the actual value of the text from the user. ■ Wrap : Specify the type of text wrapping to be used in a multiple-row text control. This attribute is ignored for a single-row component. By default, the attribute is set to soft, which means multiple-row text wraps visually, but does not include carriage returns in the submitted value. Setting this attribute to off will disable wrapping: the multiple-row text will scroll horizontally. Setting it to hard specifies that the value of the text should include any carriage returns needed to wrap the lines. ■ ShowRequired : Specify whether or not to show a visual indication that the field is required. Note that setting the required attribute to true will also show the visual indication. You may want to use the showRequired attribute when a field is required only if another field’s value is changed. ■ Changed : Specify whether or not to show a blue circle whenever the value of the field has changed. If you set this to true, you may also want to set the changedDesc attribute. ■ ChangedDesc : Specify the text to be displayed in a tooltip on a mouseover of the changed icon. By default, the text is Changed. You can override this by providing a different value. ■ AccessKey : Specify the key to press that will access the field. ■ LabelAndAccessKey : Instead of specifying a separate label and access key, you can combine the two, so that the access key is part of the label. Simply precede the letter to be used as an access key with an ampersand . For example, if the label of a field is Description and you want the D to be the access key, you would enter Description. Using Input Components and Defining Forms 9-9 ■ Simple : Set to true if you do not want the label to be displayed.

4. Expand the Behavior section and set the following:

■ Required : Specify whether or not a value is required. If set to true, a visual indication is displayed to let the user know a value must be entered. If a value is not entered, an exception will occur and the component will fail validation. ■ ReadOnly : Specify whether the control is displayed as a field whose value can be edited, or as an output-style text control. ■ AutoSubmit : Specify whether or not the component will automatically submit when the value changes. For more information about using the autoSubmit attribute, see Section 4.3, Using the Optimized Lifecycle. ■ AutoTab : Specify whether or not focus will automatically move to the next tab stop when the maximum length for the current component is reached. ■ MaximumLength : Specify the maximum number of characters per line that can be entered into the text control. This includes the characters representing the new line. If set to 0 or less, the maximumLength attribute is ignored. Note that in some browsers such as Internet Explorer, a new line is treated as two characters. ■ Converter : Specify a converter object. For more information, see Section 6.3, Adding Conversion. ■ Validator : Specify a method reference to a validator method using an EL expression. For more information, see Section 6.5, Adding Validation. 5. Expand the Other section and set the following: ■ DimensionsFrom: Determine how you want the inputText component to handle geometry management. Set this attribute to one of the following: – auto: If the parent component to the inputText component allows stretching of its child, then the inputText component will stretch to fill the parent component, as long as the rows attribute is set to a number greater than one and the simple attribute is set to true. If the parent component does not allow stretching, then the inputText component gets its dimensions from the content. – content: The inputText component gets its dimensions from the component content. This is the default. – parent: The inputText component gets its dimensions from the inlineStyle attribute. If no value exists for inlineStyle, then the size is determined by the parent container. ■ Editable : Determine whether you want the component to always appear editable. If so, select always. If you want the value to appear as read-only until the user hovers over it, select onAccess. If you want the value to be inherited from an ancestor component, select inherit. Note: Because the value is being stored in the source of the page in XML, the ampersand character must be escaped, so the value will actually be represented in the source of the page using the characters amp; to represent the ampersand.