Sie sind auf Seite 1von 15

Manual de Developer

Oracle Forms Builder


About the Object Navigator The Object Navigator provides a hierarchical display of the objects in all open modules. Objects are grouped under the appropriate node. For example, all of the windows defined in a form module appear under the Windows node. Each object in the Object Navigator is displayed with an icon that indicates its type. For some objects, double-clicking the icon invokes an editor appropriate to that type of object. For example, double-clicking the object icon for a canvas invokes the Layout Editor. You can perform the following operations in the Object Navigator: o o o o o o expand and collapse entries to locate objects quickly select objects create and delete objects copy and move objects within and between modules switch between views to display the objects you want to work with quickly display the code associated with objects such as triggers and program units

You can select commands in the Object Navigator from the menu and from the toolbar. The toolbar provides quick access to commands. Click once on the icon for the command you want to execute. To see a pop-up description of a toolbar command, move the cursor over the icon without clicking the mouse.

Trigers (Disparadores) This object represents a block of code you write to add functionality to a default application. Every trigger object has a name, and contains one or more PL/SQL Diseo y Creacin Ing. Delvy Paredes 1

Manual de Developer statements. A trigger object encapsulates PL/SQL code so that you can associate it with an event, and execute and maintain it as a distinct object. Alert(Alerta) An alert is a modal window that displays a message notifying the operator of some application condition. Use alerts to advise operators of unusual situations or to warn operators who are about to perform an action that might have undesirable or unexpected consequences. There are three styles of alerts: Stop, Caution, and Note. Each style denotes a different level of message severity. Message severity is represented visually by a unique icon that displays in the alert window. Data Block(Bloques de Datos) A data block can be based on any of the following datasources: table view FROM clause (query datasource only) procedure transactional trigger

Canvas object(Lienzo) This object represents a background entity on which you place interface items, such as check boxes, radio groups, and text items. There are four types of canvas objects: Content, Stacked, Horizontal Toolbar, and Vertical Toolbar. List of values (LOV) object(Lista de Valores) This object represents an internal Form Builder data structure that has a column/row framework similar to a database table. An LOV object is a scrollable popup window that provides the end user with either a single or multi-column selection list. Program unit object(Unidades de Programas) This object represents a named PL/SQL function or procedure that you write in a form, menu, or library module. Although trigger objects are the primary mechanism for adding programmatic control to a Form Builder application, this object supplements trigger objects by allowing you to reuse code without having to enter it in multiple triggers. Properties(Propiedades) Son las que describen las cualidades de los objetos. Properties palette(Paleta de Propiedades) Es una ventana que nos muestra todas las propiedades de u objeto.

Diseo y Creacin Ing. Delvy Paredes 2

Manual de Developer

Module properties(Propiedades de un Mdulo) General Nombre Nombre interno del objeto. Funcional Ttulo Ttulo a visualizar por el objeto. Modulo de Mens Nombre del men a utilizar con esta pantalla. (DEFAULT&SMARTBAR permite que en la ventana aparezca o no las barras de mens y de herramientas por defecto de Developer). Windows Properties(Propiedades de la Ventana) General Nombre Nombre interno del objeto o ventana, este aparece en la barra de ttulo de la ventana. Funcional Ttulo Ttulo a visualizar por el objeto. Lienzo primario Lienzo que va a ser la lista de contenidos primarios de la ventana. Cierre Permitido Permite activar o desactivar al comando cerrar de la ventana. Movimiento Permitido Permite mover la ventana manualmente o mediante programacin. Dimencionamiento Permitido Permito o no cambiar el tamao de la ventana en tiempo de ejecucin. Maximizacin Permitida Permite activar o desactivar al comando maximizar de la ventana. Minimizacin Permitida Permite activar o desactivar al comando minimizar de la ventana. Fsica Posicin X Posicin de la ventana en la pantalla con relacin al eje de la X. Posicin Y Posicin de la ventana en la pantalla con relacin al eje de la Y. Ancho Ancho del objeto en unidades de coordenadas de la pantalla actual. Altura Altura del objeto en unidades de coordenadas de la pantalla actual. Diseo y Creacin Ing. Delvy Paredes 3

Manual de Developer

Color Color del primer plano Color de la region del segundo plano del objeto(define el color del texto de los Labels o etiquetas). Color de Fondo Color de la regin del segundo plano(color del fondo de la ventana). Fuente Fuente Se utiliza para especificar el tipo y el tamao de fuente a utilizar en el objeto. About the Layout Editor(Editor de Diseo). The Layout Editor is a graphical design facility for creating and arranging interface items and graphic objects in a form. In the Layout Editor, you work on a single canvas. Canvases are displayed in windows at runtime. You specify the window a canvas will be displayed in by setting the canvas's Window property.

About text items(elemento de texto) A text item is an interface control that displays and allows editing of text. The text is displayed in a field in either single or multi-line format. Runtime Behavior A text item appears as an empty rectangular box or container. By default, an editor can be invoked from any text item.

Barra de Herramientas de Diseo

Diseo y Creacin Ing. Delvy Paredes 4

Manual de Developer

Propiedades mas Utilizadas Funcional Activado Si puede activar o desactivar el uso del Item con maen la forma. Justificacin Justifica el texto del elemento. Restricciones Maysculas/ minsculas. Para controlar que el texto que se introduzca en el objeto salga mayscula/ minscula o mixto. Ocultar datos. Oculta los caracteres que los usuarios introducen en los elementos de textos, es muy utilizado para contraseas. Navegacin Teclado de Navegacin. Permite que el usuario pueda o no navegar con el teclado el objeto. Datos Tipo de datos Valores permitidos como entrada y forma en que se visualizan Longitud mxima Longitud mxima del valor del dato que se puede almacenar en un elemento. Valor inicial Valor por defecto asignado a un elemento siempre que se inicia un registro. Mascara de formato Visualizar la entrada y el formato aceptados para los datos del elemento de visualizacin y de textos. Format Mask property Specifies the display format and input accepted for data in text items. Character Strings The following table describes valid format masks for character strings. Element Example Description X XXXX Any alphabetic, numeric, or special character. End user input string must be exact length specified by format mask. 9 9999 Numeric characters only. End user input string must be exact length specified by format mask. A AAAA Alphabetic characters only. End user input string must be exact length specified by format mask. NUMBERS The following table describes valid format masks for numbers.

Diseo y Creacin Ing. Delvy Paredes 5

Manual de Developer

Element Example Description 9 9999 Number of nines determines display width. Any leading zeros will be displayed as blanks. 0 0999 Display leading zeros. 0 9990 Display zero value as zero, not blank. $ $9999 Prefix value with dollar sign. comma 9,999 Display a comma in this position. For correct behavior in multilingual applications, substitute G to return the appropriate group (thousands) separator. period 99.99 Display a decimal point in this position. For correct behavior in multilingual applications, substitute D to return the appropriate decimal separator. When you mask a number with nines (9), Form Builder adds a space in front of the number to accommodate the plus (+) or minus (-) sign. However, since the plus sign is not displayed, it appears as if Form Builder adds a space in front of the number. (The minus sign is displayed.) To embed additional characters such as a hyphen (-) or a comma (,), surround the character with double-quotes (").

NUMBER Examples Format Mask Description 099"-"99"-"9999 Displays the social security number as formatted, including hyphens, even if end user enters only nine digits.To create a Social Security column, create an 11-character column, set to fixed length, with a format mask of 099"-"99"-"9999. This mask will accommodate Social Security numbers that begin with zero, accepting 012-34-5678 or 012345678 (both stored as 012345678). Format Mask User enters Result 99.9 21.1 21.1 99.9 01.1 1.1 Format Mask property When you prefix a date mask with FX, the end user must enter the date exactly as you define the mask, including the specified delimiters: Date Examples Format Mask FXDD-MON-YY Description Will accept 12-JAN-94, but will not accept 12.JAN.94 or 12/JAN/94 because the delimiters do not match the mask. Will not accept 12JAN94 because there are no delimiters. Will accept 01-JAN-94 but will not accept 1-JAN-94. Will accept 01-JAN-94. Will also accept the entry of other delimiters, for example 01/JAN/94 and 01 JAN 94. Diseo y Creacin Ing. Delvy Paredes 6

FMDD-MON-YY

Manual de Developer However, will not accept 01JAN94. Will accept 1-JAN94, converting it to 01-JAN-94.

DD-MON-YY

Will accept 12.JAN.94, 12/JAN/94 or 12-JAN-94. Note: Any delimiter characters will be accepted, but if delimiters are omitted by the end user, this mask will interpret date characters as a delimiters. Will accept 12-JAN94, (but will erroneously interpret as 12-JAN-04); but will not accept 12JAN94, because "AN" is not a valid month name.

Label(Texto) Labels can contain more than one word and any punctuation character. When Triggers When-Button-Pressed When-Checkbox-Changed When-Clear-Block When-Create-Record When-Custom-Item-Event When-Database-Record When-Form-Navigate When-Image-Activated When-Image-Pressed When-List-Activated When-List-Changed When-Mouse-Click When-Mouse-DoubleClick When-Mouse-Down When-Mouse-Enter When-Mouse-Leave When-Mouse-Move When-Mouse-Up When-New-Block-Instance When-New-Form-Instance When-New-Item-Instance When-New-Record-Instance When-Radio-Changed When-Remove-Record When-Tab-Page-Changed When-Timer-Expired When-Validate-Item When-Validate-Record When-Window-Activated When-Window-Closed Diseo y Creacin Ing. Delvy Paredes 7

Manual de Developer When-Window-Deactivated When-Window-Resized When-Button-Pressed Trigger Fires when an operator selects a button, by clicking with a mouse, or using the keyboard. KEY-NEXT-ITEM Asigna el foco al proximo Item del form. Definition Level form, block, or item Example: Commit_Form; COMMIT_FORM built-in Causes Form Builder to update data in the database to match data in the form. Form Builder first validates the form, then, for each block in the form, deletes, inserts, and updates to the database, and performs a database commit. When-Validate-Item Trigger Fires during the Validate the Item process. Specifically, it fires as the last part of item validation for items with the New or Changed validation status. Definition Level form, block, or item Example: BEGIN SELECT description INTO :Employee.Commplan_Desc FROM commplan WHERE commcode = :Employee.Commcode; EXCEPTION WHEN No.Data_Found THEN Message('Invalid Commission Plan, Use <List> for help'); RAISE Form_Trigger_Failure; WHEN Too_Many_Rows THEN Message('Error. Duplicate entries in COMMPLAN table!'); RAISE Form_Trigger_Failure; END; When-New-Item-Instance Trigger Fires when the input focus moves to an item. Specifically, it fires after navigation to an item. select nvl(max(estudiante.cod_est),0)+1 into :cod_est from estudiante; Para ir incrementando el valor de un campo de forma secuencial. When-New-Form-Instance SET_WINDOW_PROPERTY(forms_mdi_window, window_state, maximize); Permite que la ventana se ejecute de forma maximizada. Diseo y Creacin Ing. Delvy Paredes 8

Manual de Developer

SET_ITEM_PROPERTY('fecha_bautizo', ENABLED, property_false); Permite habilitar o deshabilitar un objeto de la ventana. About the PL/SQL Editor The PL/SQL Editor is where you enter and compile code objects. Code objects in Form Builder include event triggers, subprograms (functions and procedures), menu item commands, and menu startup code.

Comandos Mas Utilizados CREATE_RECORD built-in Creates a new record in the current block after the current record. Form Builder then navigates to the new record. Syntax CREATE_RECORD; DELETE_RECORD built-in When used outside an On-Delete trigger, removes the current record from the block and marks the record as a delete. Records removed with this built-in are not removed one at a time, but are added to a list of records that are deleted during the next available commit process. If the record corresponds to a row in the database, Form Builder locks the record before removing it and marking it as a delete. If a query is open in the block, Form Builder fetches a record to refill the block if necessary. See also the description for the CLEAR_RECORD built-in subprogram. In an On-Delete trigger, DELETE_RECORD initiates the default Form Builder processing for deleting a record during the Post and Commit Transaction process, as shown in Example 2 below. Syntax DELETE_RECORD; CLEAR_FORM built-in Causes Form Builder to remove all records from, or flush, the current form, and puts the input focus in the first item of the first block. Syntax Diseo y Creacin Ing. Delvy Paredes 9

Manual de Developer

Commit; CLEAR_FORM; COMMIT_FORM built-in Causes Form Builder to update data in the database to match data in the form. Form Builder first validates the form, then, for each block in the form, deletes, inserts, and updates to the database, and performs a database commit. As a result of the database commit, the database releases all row and table locks. Syntax COMMIT_FORM; NEXT_RECORD built-in Navigates to the first enabled and navigable item in the record with the next higher sequence number than the current record. If there is no such record, Form Builder will fetch or create a record. If the current record is a new record, NEXT_RECORD fails. Syntax NEXT_RECORD; PREVIOUS_RECORD built-in Navigates to the first enabled and navigable item in the record with the next lower sequence number than the current record. Syntax PREVIOUS_RECORD; FIRST_RECORD built-in Navigates to the first record in the block's list of records. Syntax FIRST_RECORD; LAST_RECORD built-in Navigates to the last record in the block's list of records. If a query is open in the block, Form Builder fetches the remaining selected records into the block's list of records, and closes the query. Syntax LAST_RECORD; GO_ITEM built-in GO_ITEM navigates to an indicated item. GO_ITEM succeeds even if the target item has the Keyboard Navigable property set to No. Syntax GO_ITEM (item_id Item); Diseo y Creacin Ing. Delvy Paredes 10

Manual de Developer BEGIN Go_Item('pref_dialog.printer_name'); END; Para controlar que los campos no pasen vacos a nivel de programacin el cdigo es el siguiente: if :apellidos is null then message('El campo no puede estar vaco'); message('El campo no puede estar vaco'); else if :apellidos is not null then next_item; end if; end if; TRABAJAR CON PROCEDIMIENTOS EN DEVELOPER PROCEDURE pr_camp_vacio IS BEGIN if :apellidos is null then message('El campo no puede estar vaco'); message('El campo no puede estar vaco'); go_item('apellidos'); else commit; clear_form; IF :system.mode = 'ENTER-QUERY'THEN SET_ITEM_PROPERTY('nuevo', ENABLED, property_false); END IF; SET_ITEM_PROPERTY('fecha_bautizo', ENABLED, property_false); SET_ITEM_PROPERTY('fecha_pri_com', ENABLED, property_false); SET_ITEM_PROPERTY('fecha_confirmacion', ENABLED, property_false); Message('Transaccin completada con xito... un registro guardado.'); end if; END;

Diseo y Creacin Ing. Delvy Paredes 11

Manual de Developer

Creating a new menu module To create a new menu module from scratch: Select the Menus node in the Object Navigator and click the Create button in the toolbar. Form Builder creates a new menu module in the Object Navigator with a default name, such as MODULE1. Replace the default name with a more meaningful name.

Comando para abrir una forma desde un botn.


OPEN_FORM built-in Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time. Ejemplo: open_form('C:\colegio\registros\reg_profesor.fmx'); EXIT_FORM built-in Provides a means to exit a form, confirming commits and specifying rollback action. In most contexts, EXIT_FORM navigates outside the form. If there are changes in the current form that have not been posted or committed, Form Builder prompts the operator to commit before continuing EXIT_FORM processing. If the operator is in Enter Query mode, EXIT_FORM navigates out of Enter Query mode, not out of the form.

Ejemplo: exit_form; Diseo y Creacin Ing. Delvy Paredes 12

Manual de Developer

Report Builder
Object Navigator The Object Navigator provides a hierarchical display of all major objects in a report, including attached libraries and external queries. Using this view, you can take such actions as select an object, bring up the Property Palette for an object, edit an object's PL/SQL, drag and drop PL/SQL program units, and search for an object by name.

Unused data model objects(Modelo de Datos) Make sure that you remove or suppress any data model objects that are not actually used in your report. If your data model includes a query that is only used in certain cases (i.e., when a parameter is set to a certain value), you can conditionally suppress the query with the SRW.SET_MAXROW packaged procedure. SRW.SET_MAXROW ( queryname, 0) will cause the query to fetch no records.

Diseo y Creacin Ing. Delvy Paredes 13

Manual de Developer

Layout Model view(Modelo de Diseo) The Layout Model view is a work area in which you can define the format of your report output. To do this, you work with layout objects, such as frames, repeating frames, fields, boilerplate, anchors, and Graphics objects. When you run a report, Report Builder uses the Layout Model as a default template for the report output. This template will grow or shrink based on the data fetched for and the PL/SQL logic assigned to the layout objects.

Parameter Form view(Pantalla de Parmetros) The Parameter Form view is the work area in which you define the format of the report's Runtime Parameter Form. To do this, you define and modify parameter form objects (fields and boilerplate). When you run a report, Report Builder uses the Parameter Form view as a template for the Runtime Parameter Form. Fields and boilerplate appear in the Runtime Parameter Form exactly as they appear in the Parameter Form view. If you do not define a Runtime Parameter Form in the Parameter Form view, Report Builder displays a default Parameter Form for you at runtime.

Diseo y Creacin Ing. Delvy Paredes 14

Manual de Developer

Diseo y Creacin Ing. Delvy Paredes 15

Das könnte Ihnen auch gefallen