Skip to main content

015 Building an Application part 09 DynamicAction Validation Oracle Apex...





 Changing the Project Form Appearance with Live Template Options
Consistency is important for your application’s usability. Update
the properties of the
Project form modal dialog to match the look and
function of the Maintain Team Member modal dialog. Some of
this should seem familiar because you are applying the same
set of settings from earlier in the tutorial to a new page.
Use the Live Template Options
on the Developer Toolbar to modify the appearance of the form in the
runtime, then switch to Page Designer for more elaborate changes
(such as moving buttons and changing the condition
of fields).
1.   On the Projects page in
the runtime, click the Edit icon
(pencil) adjacent to the name of any project.
The browser navigates to
the Maintain Project form.
To update the page using
Live Template Options:
2.   On the Developer Toolbar,
click Quick Edit.
1.   Hover your mouse over the Maintain Project region (not the page title).
A wrench icon appears in
the top-right corner.
2.   Click the wrench icon.
The Live Template Options
dialog appears.
3.   In Live Template Options:
a.   Header - select Hidden
but accessible
b.   Style - select Remove
UI Decoration
c.   Item Padding - select Slim
Padding
The page updates with each change.
4.   Click Save.

 Updating the Project Form in Page Designer

1.   On the Developer Toolbar,
click Edit Page 5 to return to the
page in Page Designer.
To move the navigation
buttons for the project entries to the Create position:
2.   In the middle of the Layout
tab
, locate the existing buttons near the bottom of the Maintain Project
region (not the sub region).
1.   Press and hold the Ctrl key and click the following
buttons to select both of them:
         
GET_PREVIOUS_ROWID
         
GET_NEXT_ROWID
4.   In the Property Editor:
a.       Layout: Region - select Breadcrumb
b.      Layout: Button Position - select Create

To
make the Name field required:
4.   In the Content Body region, select the P5_NAME item.
5.   In the Property Editor:
a. Identification: Type - select Text Field To add a LOV to the Project Lead field:
6.   Select the P5_PROJECT_LEAD item.
7.   In the Property Editor:
Creating a Static LOV of Statuses
a.   Identification: Type - select Select List
b.   List of Values: Type - select Shared Component
c.   List of Values: List of Values- select TEAM MEMBERS
d.   List of Values: Display Extra Values - select No
e.   List of Values: Null Display Value - enter - Select Project Lead -

Creating a Static LOV of Statuses

To define a list with static values:

1.   In the Layout or Rendering
tree, select the P5_STATUS item.
2.   In the Property Editor:
a.   Identification: Type - select Select List
b.   List of Values: Type - select Static Values
c.   List of Values: Static Values
- delete the current contents, then enter
STATIC2:Assigned,In-Progress,Completed 





Note:   Specifying
STATIC2 displays the records in the order entered, rather than alphabetically.





a.   List of Values: Display Extra
Values - select No
b.   List of Values: Display Null
Values - select No
A good business practice is to require users to input a date for when a project is updated to "Completed." 
To make the Completed Date required when a project status is changed to Completed:
3.   Select the P5_COMPLETED_DATE item.
4.   In the Property Editor:
a. Appearance: Template - select Required

Creating a Dynamic Action 

To create a Dynamic Action:
1.   In the Rendering tree, right-click the P5_STATUS item and
select Create Dynamic Action.
A Dynamic Actions folder
populates as a child to P5_STATUS.
2.   In the Property Editor:
a.   Identification: Name - enter Show Completed Date
b.   Client-side Condition: Type -
select Item = Value
c.   Client-side Condition: Value -
enter
Completed 
To create a Dynamic Action:
1.   In the Rendering tree,
right-click the P5_STATUS item and
select Create Dynamic Action.
A Dynamic Actions folder
populates as a child to P5_STATUS.
2.   In the Property Editor:
a.   Identification: Name - enter Show Completed Date
b.   Client-side Condition: Type -
select Item = Value
c.   Client-side Condition: Value -
enter
Completed

Adding a Validation for the Completed Date

1.   On the Maintain Project page
in Page Designer, select the Processing
tab (two arrows chasing one another) above the Rendering tree.
1.   Right-click the Validating folder and select Create Validation.
2.   In the Property Editor:
a.   Identification: Name - enter Completed Date is Not Null
b.   Validation: Type - select Item is NOT NULL
c.   Validation: Item - select P5_COMPLETED_DATE
d.   Error: Error Message - enter #LABEL# must have some value
e.   Error: Associated Item -
select P5_COMPLETED_DATE
f.    Server-side Condition: Type -
select Item = Value
g.   Server-side Condition: Item -
select P5_STATUS
Server-side Condition: Value - enter Completed
To add a Validation for Completed Date is not Forward Dated:
4.   Right-click the Validating folder and select Create Validation.
5.   In the Property Editor:
a.   Identification: Name - enter Completed
Date is not Forward Dated
b.   Validation: PL/SQL Expression - enter :P5_COMPLETED_DATE
<= sysdate
c. Error: Error Message - enter #LABEL#
cannot be forward dated
d. Error: Associated Item - select P5_COMPLETED_DATE
e. Server-side Condition: Type - select Item is NOT NULL
f.   Server-side Condition: Item - select P5_COMPLETED_DATE 6. Click Save.

Copying a Sub Region to a Different Page

To delete the four
existing audit items on Maintain Project form:
1.   In the Layout tab, press and hold the Ctrl key and click the following items to select them:
       P5_CREATED
      P5_CREATED_BY
       P5_UPDATED
       P5_UPDATED_BY
Do one of the following:

        Right-click one of the items and select Delete.
        Press the Delete key.
2.   Click Save
To copy the Audit Details sub region from Page 3 to Page 5:
3.   In Page Designer, navigate to
Page 3.
4.   Click the Rendering tab.
5.   In the Rendering tree,
right-click the Audit Details sub
region and select Copy to other Page...
1.   In the Copy Region dialog:
a.   To Page - enter 5
b.   Copy Region Items - select Yes
2.   Click Next.
3.   Click Copy.
10.Navigate back to Page 5 to confirm the Audit
Details sub region copied to page 5 Content Body as a region (not a sub
region).
To update the Audit Details sub region for the Maintain Project form:
On page 5, in the Rendering tree or Layout, select the Audit Details region.
12.In the Property Editor
a. Layout: Parent Region - select the first Maintain Project
Click Save and Run Page.

.Try out these functions to see how the page responds:

   Change the Status and see how the Completed Date is shown or hidden
depending on the status selected.
   Save a record with a Status of Completed and no Completion Date - An
error message should display.
    Save a record with a Completion Date in the future - An error message
should display.

Comments

Popular posts from this blog

Oracle APEX - Tabular form datepicker month and year selector

Customize LOGIN PAGE Using css! Oracle Apex

body{font-family: 'Droid Arabic Kufi', sans-serif; font-size:1.3rem;} .t-PageBody--login .t-Body { background-image: url(#WORKSPACE_IMAGES#BG.jpeg); background-position: center center; background-repeat:  no-repeat; background-attachment: fixed; background-size:  cover; background-color: #45484d; background-color: -moz-linear-gradient(top, #45484d 0%, #000000 100%); background-color: -webkit-linear-gradient(top, #45484d 0%,#000000 100%); background-color: linear-gradient(to bottom, #45484d 0%,#000000 100%); } body .t-Login-title , .t-Login-region {     background-color: rgba(128, 152, 180, 0.51); color: #F8F8F8 } .t-Login-body {     text-align: right; } .popup {   z-index: 10; margin:100px auto; display:block; text-align:center; -moz-box-shadow: 0 0 10px rgba(0,0,0,.18); /* drop shadow */ -webkit-box-shadow: 0 0 10px rgba(0,0,0,.18); /* drop shadow */ -o-box-shadow: 0 0 10px rgba(0,0,0,.18); /* drop shadow */ box...

Oracle APEX 20.2 Patch p32006852_2020_Generic Installation