What are the advantages of using the form wizard, instead of the form button, to create a form?
You can include a variety of different types of forms in your applications. You can include forms that enable users to update just a single row in a table or multiple rows at once. Application Builder includes a number of wizards you can use to create forms automatically, or you can create forms manually. Show
Topics in this section include:
Creating a Form Using a WizardThe easiest way to create a form is to use a wizard. For example, the Form on Table or View Wizard creates one item for each column in a table. It also includes the necessary buttons and processes required to insert, update, and delete rows from the table using a primary key. Each region has a defined name and display position; all other attributes are items, buttons, processes, and branches. To create a form using a wizard:
Creating a Tabular FormA tabular form enables users to update multiple rows in a table. The Tabular Form Wizard creates a form to perform update, insert, and delete operations on multiple rows in a database table. To create a tabular form:
Note: Any modification of the select list of a SQL statement of a tabular form after it has been generated is not recommended. If you do modify the query, make sure the values of the updateable columns are not altered after being queried from the database by the Application Express engine. Creating a Master Detail FormA master detail form reflects a one-to-many relationship between two tables in a database. Typically, a master detail form displays a master row and multiple detail rows within a single HTML form. With this form, users can insert, update, and delete values from two tables or views. To create a master detail form:
Creating a Form ManuallyYou can also create a form manually by performing the following steps:
To create a form manually by creating and HTML region:
Creating an Automatic Row (DML) Processing ProcessOne common way to implement a form is to manually create an Automatic Row Processing (DML) process. This approach offers three advantages. First, you are not required to provide any SQL coding. Second, Oracle Application Express performs DML processing for you. Third, this process automatically performs lost update detection. Lost update detection ensures data integrity in applications where data can be accessed concurrently. To implement this approach you need to:
To create an Automatic Row Processing (DML) process:
Creating a Process that Contains One or More Insert StatementsIn this approach to form handling, you create one or more processes to handle insert, update, and delete actions. Instead of having the Application Express engine handling everything transparently, you are in complete control. For example, suppose you have a form with three items:
Assume
also there are three buttons labeled Insert, Update, and Delete. Also assume you have a table T that contains the columns To process the insertion of a new row, you create a conditional process of type PL/SQL that executes when the user clicks the Insert button. For example: BEGIN INSERT INTO T ( first_name, last_name ) VALUES (:P1_FIRST_NAME, :P1_LAST_NAME); END; To process the updating of a row, you create another conditional process of type PL/SQL. For example: BEGIN UPDATE T SET first_name = :P1_FIRST_NAME, last_name = :P1_LAST_NAME WHERE ID = :P1_ID; END; To process the deletion of a row, you create a conditional process that executes when the user clicks the Delete button. For example: BEGIN DELETE FROM T WHERE ID = :P1_ID; END; Using a PL/SQL API to Process Form ValuesFor certain types of applications, it is appropriate to centralize all access to tables in a single or a few PL/SQL packages. If you created a package to handle DML operations, you can call procedures and functions within this package from an After Submit PL/SQL process to process insert, updates, and delete requests. Populating FormsOracle Application Express populates a form either on load or when the Application Express engine renders the page. You can populate a form in the following ways:
To create an Automated Row Fetch process:
You can also populate a form manually by referencing a hidden session state item. For example, the
following code in an Oracle Application Express process of type PL/SQL would set the values of FOR C1 in (SELECT ename, sal FROM emp WHERE ID=:P2_ID) LOOP :P2_ENAME := C1.ename; :P2_SAL := C1.sal; END LOOP; In this example:
Validating User Input in FormsYou can use validations to check data a user enters before processing. Once you create a validation and the associated error message, you can associate it with a specific item. You can choose to have validation error messages display inline (that is, on the page where the validation is performed) or on a separate error page. Creating an inline error message involves these steps:
Creating a ValidationTo create a validation:
Note: Validations cannot contain more than 3,950 characters. Associating a Validation with a Specific ItemTo associate an item with a validation and specify error message text:
About Error MessageError message display location identifies where a validation error message displays. Validation error messages can display on an error page or inline within the existing page. Inline error messages can display in a notification area (defined as part of the page template) or within the field label. To create a hard error that stops processes, including any remaining validations, you must display the error on an error page. What are the benefits of using the form wizard?The Form Wizard gives you more control over your results than one-click forms do. The wizard lets you make decisions about certain aspects of a form's design and produces a form based on your instructions.
When should we use a form wizard to create a form?The wizard also lets you define how the data is grouped and sorted, and you can use fields from more than one table or query (provided that you specified the relationships between the tables and queries beforehand).
What is the disadvantage of using the form wizard?Explanation: Access databases include a size limitation of 2 GB, 32,768 objects and 255 simultaneous users. These limitations won't pose a problem for most users. However, large multiuser applications or even single, large, single-user databases including multimedia fields, will quickly hit the database limitations.
|