Continuation of the tutorial.
This section describes how to create an Oracle APEX application and create pages in an application.
Previous part: Oracle Application Express Tutorial. IDE Overview
Creating an application
Default pages
Application launch
Creating pages
Main components of pages
Visual elements
Non-visual elements
Basic properties of elements
General properties
Page properties
To create an application, you need to go into App Builder and click the "Create" button.
In the previous versions of the apex, in the first step, the wizard suggested choosing the type of application (in versions 4.x, if memory serves me, these were the types of "Database application" and "Websheet Application", in versions 5.x - "Desktop", "Mobile "," Websheet "and" Packaged Application "), in the current version all the other types were pushed a little to the side (although" Websheet "remained), and you just need to select" New Application ". And "Packaged Application" are those demo applications from App Gallery .
Next, the application creation wizard will start. In the first step, you need to select "New Application", on the second - just fill in the "Name" and "Application ID" fields (application number). The name is needed simply because it is a required field, and the Application ID
is because it will not be possible to change it later. More precisely, it is possible (through export / import), but it is long and tedious, it is better to immediately set the desired number if the automatically generated apex does not suit you. The number must be unique. This number is used as part of the application address. Look at the typical apex URL:
https://apex.oracle.com/pls/apex/f?p=123456:1:14675052744498:::::
Here 123456
is the application ID.
You can ignore the remaining fields in the wizard for now, all these settings can be changed later.
After that, you need to click "Create Application", the apex will create the application and automatically take you to the application page, where you will see.
By default, the apex will create 3 pages in the application. Pages, as well as applications, have a number and title. The number is also used in the URL to identify the page, it immediately follows the application number and is separated from it by a colon. That is, the format is:
https://apex.oracle.com/pls/apex/f?p=APPLICATION_ID:PAGE_ID:< url>
Default pages are:
Home page (page ID: 1)
This is the starting page of the application. You will get it by default after entering your login and password in the application, or if you specify the URL of your application without specifying the page and everything else, that is:
https://apex.oracle.com/pls/apex/f?p=123456
Applications and pages also have the useful property of Alias
. For an application, this property is configured in the application properties ("Application Properties" - "Definition" - "Name" - "Application Alias"), and for the page - in the page editor in the properties panel to the right. Alias
can be used in the URL of the page instead of the number. The default login page is created with the LOGIN_DESKTOP LOGIN_DESKTOP
, and the home page is created with the HOME
alias. If you set the application alias MY_APP
, then the login page can be accessed at
https://apex.oracle.com/pls/apex/f?p=MY_APP:LOGIN_DESKTOP
What will happen if application 123 is made alias 456, and application 456 is alias 123? Nothing will happen, the apex will not allow such aliases to be made to applications. This is not spelled out clearly in the help, but the application alias seems to be subject to the rules for identifier names in PL / SQL.
What will happen if page 123 is made alias 456, and page 456 is alias 123? Nothing will happen, such aliases can be given to the pages, but they will be ignored. 123 in the url will open the page with the number 123.
Now that the application has been created, it can already be “launched” (only there is nothing to look at for now). This is not exactly the same as running a normal application (as in Windows or Linux). The apex application is rendered with the same engine as the IDE itself, so once you have created the application, it is instantly ready for use, and any person who enters his address in the address bar can work with it. The actual launch of the application, in fact, is just such a name for opening the start page (the one with the number 1). You can run the application in many ways:
These two buttons are in almost any section of the IDE. The left contains the number of the last page that you opened in the page editor. Clicking on it will take you to editing this page, and clicking on the right button will launch this page.
What happens after launch? If the page being launched has limited access, the user will first be redirected to the login page. If the user is already logged in, or the settings page is designated as public, this page will open.
By default, the page is created with limited access. There are two possible settings in the page properties (Page editor - right panel - property group "Security" - "Authentication"):
Page Requires Authentication
: the page will be accessible only to logged in users during the session;Page is Public
: public page, visible to registered and unregistered users.You can create a page on the application page . Click "Create", then the page creation wizard will start. Wizard Steps:
After this page is created and ready to use.
Visual elements are elements that are somehow displayed on the screen. It:
Reports and graphs can be viewed as variations of regions (technically, they are), but they are rather independent entities with their own behavior, properties, and so on.
These are elements to ensure the logic of the application. There is actually a huge variety of elements, although the user literally can not see them. Basic types:
The basic properties characteristic of each (or almost every) type of elements. They can be viewed and modified in the page editor, where they are grouped together. Here I will briefly describe their purpose (so that you will know what to look for), and I will tell you in more detail in other articles.
Identification
: sets the element name and additional properties (depending on the type);Appearance
: properties responsible for the appearance of the visual element. For each type of element there is a set of templates, you can choose one of them here ( Template
property). Also, templates have additional settings ( Template Options
- by clicking on the button, a window with settings will open);Layout
: Adjust the position of the visual element on the page. The elements are arranged in a grid of 12 columns, here you can specify exactly how they should be located;Source
: for regions and items, the source of data to be displayed, for processes, the process code;Server-side Condition
: a condition that is checked on the server (there is a huge choice of conditions, from simple ones, such as such an element has such a value to arbitrary PL / SQL code). The element will be displayed on the page, if this condition is met, and if not, it will not. And it will not be hidden, but simply not rendered;Client-side Condition
( Dynamic Action
): condition checked on the client (without accessing the server). DA will be satisfied if the condition is met;Read only
: works the same way as Server-side Condition
, only controls not the presence / absence of the element, but the ability to change the value. This property is in items, regions and pages. For an item, it applies to the item itself, and for regions / pages, it applies to all items within the corresponding region / page;Security
: control access to the item. In principle, all the same can be done using Server-side Condition
, but it is better to distinguish between: Server-side Condition
for application logic, Security
for display depending on access rights.Configuration
: to enable / disable the Build Option
. A very non-obvious thing, but very useful: allows you to turn on and off individual features of the application, which is very convenient when you are developing parallel features for several different releases;Comments
: comments for other developers;Help
(for visual elements): help for end users of the application.Properties specific to pages:
Navigation
: there are two properties in this group. Cursor Focus
specifies whether to transfer the focus to the input field on the page immediately after charging (options are either not to transmit, or to transfer to the first field on the page). Warn on Unsaved Changes
does not allow the user to leave the page if there is unsaved data;JavaScript
: allows you to add JavaScript code to the page. You can specify the path to the file or add your code directly to the page;CSS
: the same for CSS. Attach a file or add to the page if the necessary local CSS setting is only for this page;Advanced
: allows you to enable or disable protection against re-submitting a form.Source: https://habr.com/ru/post/446036/
All Articles