Date post: | 16-Apr-2017 |
Category: |
Software |
Upload: | jorge-rimblas |
View: | 105 times |
Download: | 3 times |
Jorge RimblasSenior APEX Consultant
@rimblasrimblas.com/blog
Oracle DB since 1995APEX since it was HTMLDB in 2004Always involved in web technologiesjrimblas in OTN Forums
Contributor to"Expert Oracle Application Express, 2nd Edition"with "Themes & Templates" chapter
1 . 2
Age: 13 years!Staff: 80+ employees68 consultants/developers2015: 60% GrowthAPEX Solutions: 12 Years!Largest APEX practice in North AmericaOracle Center of Excellence
1 . 3
When event
What to do?
What to do?
WhenTrue
WhenFalse
[Optional Client Side Condition]
[Affected Elements]
[Affected Elements]
7 . 2
Event/When?When will the Dynamic Actionexecute?
On click
On item (data) change
On Focus
On Page Load
On (any) browser event
etc
8 . 2
Where?Where will the event happen?
Item(s)
Button
Region
jQuery Selector
JavaScript Expression
8 . 4
Show Text Item "Enter User"Hide List Item "Select User"Show "Switch to Select User" ButtonHide "Switch to Enter User" Button
Show List Item "Select User"Hide Text Item "Enter User"Show "Switch to Enter User" ButtonHide "Switch to Select User" Button
9 . 6
Often used as part of several True Actions.Often used to set a hidden item
Hidden Item needs: "Value Protected" = No
$s("{ITEM}", "{VALUE}");
// Set to today$s("P30_LOG_DATE", "&P30_TODAY.");
// Clear date$s("P30_LOG_DATE", "");
Equivalent to $s API
11 . 3
Name to Uppercase Code
this.triggeringElement.value .toUpperCase() .replace(/\s+/g, '_') .substring(0, 20);
1. Value of the triggeringElement2. Make it uppercase3. Globally Replace spaces (\s) with "_"4. Only return the first 20 characters
12 . 4
AJAXasynchronous JavaScript and XML
group of interrelated Web developmenttechniques used on the client-side to createasynchronous Web applications
Wikipedia: en.wikipedia.org/wiki/Ajax_(programming)
14 . 1
Assign Role
1. Event: On Button Click2. Insert new role3. Refresh Role Dropdown4. Refresh Report
insert into app_user_roles ( username , role_key)values ( :P215_USERNAME , :P215_ROLE_KEY);
15 . 5
Remove Role
1. Event: On .deleteRow Click2. Delete role3. Refresh Role Dropdown4. Refresh Report
delete from app_user_roles where id = :P215_UR_ID;
15 . 6
Remove Role1. Event: On .deleteRow Click2. Ask for Confirmation3. Use "Set Value" to save ID of clicked row4. Delete role5. Give Confirmation6. Refresh Role Dropdown7. Refresh Report
15 . 7
Get the ID value
this.triggeringElement.getAttribute("data-id");
this.triggeringElement.dataset.id
15 . 8
Dataset / Data Attributes// data-id="{value}"this.triggeringElement.dataset.id
// data-active="YES"this.triggeringElement.dataset.active
// data-selected="YES"this.triggeringElement.dataset.selected
// data-lineID="123"this.triggeringElement.dataset.lineID
// data-rownum="2"this.triggeringElement.dataset.rownum
15 . 10
triggeringElementAvailable inside the DA JavaScript
var el = this.triggeringElement;
var $el = $(this.triggeringElement);
18 . 1
Name to Uppercase Code
this.triggeringElement.value .toUpperCase() .replace(/\s+/g, '_') .substring(0, 20);
1. Value of the triggeringElement2. Make it uppercase3. Globally Replace spaces (\s) with "_"4. Only return the first 20 characters
18 . 2
ResourcesDemo [ ]
( )
Install & Review Packaged Application:"Sample Dynamic Actions"
apex.oracle.com/pls/apex/f?p=90770 Download
JavaScript.com
dynamic-actions.comEasy Prototyping with triggeringElement
rimblas.com/blog/2014/06/easy-prototyping-when-using-apex-da-
triggeringelement/
20 . 1
@rimblas
Q&APractical Dynamic Actions
Jorge Rimblas
rimblas.com/blog
21