Presentation is loading. Please wait.

Presentation is loading. Please wait.

Karen Cannell kcannell@thtechnology.com APEX: Tight Tabular Forms Karen Cannell kcannell@thtechnology.com http://www.thtechnology.com.

Similar presentations


Presentation on theme: "Karen Cannell kcannell@thtechnology.com APEX: Tight Tabular Forms Karen Cannell kcannell@thtechnology.com http://www.thtechnology.com."— Presentation transcript:

1 Karen Cannell kcannell@thtechnology.com
APEX: Tight Tabular Forms Karen Cannell

2 Volunteer to author ODTUG Journal Articles!
About Me … Karen Cannell ~ Consultant, TH Technology Analyzed, designed developed, converted, upgraded, enhanced and otherwise worked on database applications for 25+ years, focused on Oracle since 1994. Currently migrating business processes from paper to web-based systems, leveraging the Oracle 10g & 11g suite of tools. Lately APEX. Editor, ODTUG Technical Journal Volunteer to author ODTUG Journal Articles! Using APEX since the HTMLDB beginning

3 About You … (Audience Background)
New to APEX? APEX Experience? Previous Tools? APEX Training? Version 2.0? 3.1 ? 3.2 ? 4.0?

4 Agenda Tabular Forms, <= APEX 3.2 Tabular Forms, Manual
Loose Tabular Forms, Manual Tighter and Tedious Tabular Form 4.0 Enhancements Tighter, less work OOTB Tabular Form Custom Tightest and (a bit) less Tedious

5 Tabular Forms Multiple Rows, Columns at Once

6 Tabular Form vs. Updateable Report
Coding w/the Enemy: JDeveloper as PL/SQL IDE April 26, 2006 Tabular Form vs. Updateable Report Tabular Form = = Updateable Report Report + editable items + MRU, MRD, Add Row Processes. Try adding fly-in HTML, CSS, XML, JavaScript URL COLLABORATE ' Paper 532

7 Tabular Forms <= APEX 3.2 ~ Loose ~

8 The Problem? (<= APEX 3.2)
Limited Out-of-the-Box Validations Required, Format Mask Column Checks Only No Per Row No “Has Row Changed?” Error Message Stops on First Error Does Not Show Row/Column of Error Too Loose! Bad Data In … Bad Data Out … Need to Tighten Up …

9 Tabular Forms <= APEX 3
Tabular Forms <= APEX 3.2 Plus Manual Validations ~ Tighter, Tedious ~

10 Tabular Form No Element Names Where to Add Validations?

11 Tabular Form Validations - Solutions
Use a Developer Framework i.e. APEXLib Manually Code Validations

12 APEXLib APEXLib Development Framework
For APEX <- 3.2, Tabular form Enhancements Help Not an Oracle Product Not part of APEX

13 APEXLib Tab Form Features
Reference columns by name without having to find which array your column is mapped to To get the correct number of rows to process Identify which row has changed Get your data with the correct data type (NUMBER, DATE) without having to take care about format masks. Add a required column check by declaration, instead of coding it. Get more meaningful error message than APEX provides. These Features are in APEX 4.0

14 To Manually Code Validations:
Get the Generated Item Names or Use APEX_ITEM in SQL Query then Use APEX_APPLICATION.g_fxx Arrays to Manually Write Validation/Processing Procedures

15 Generated Item Names Each Item has a Handle Handle   Aligns with an
per Wizard’s Standard Naming Convention Handle   Aligns with an APEX_APPLICATION.g_fxx Array

16 WebDeveloper Show ID & Class Details

17 Manual Tab Form Processing Has the Row Changed?

18 Tabular Forms APEX 4.0+ ~ Tighter, Less Work ~

19 APEX 4.0 Tabular Forms Validations!! NOT NULL Column String Comparison
e.g. value is numeric, value is a date, value only contains the following characters etc. Error Message Error Cell Highlighting

20 Tabular Form - Validations

21 Tabular Form - Validations
Columns

22 Tabular Form Validations
NOT NULL String Comp

23 Tabular Form – String Comp
String Comparison Options

24 Tabular Form Validations
Error Display Location

25 Tabular Form – Error Messages
Column and Row

26 Tabular Form Validations
Page

27 Tabular Form Validations - Page
SQL, PL/SQL Use APEX_APPLICATION.g_fnn Arrays

28 4.0 Tabular Forms - Limitations
Cannot Directly Reference Column Values i.e. like Page Items Field Highlighting Only via Declarative Validations Default NOT NULL Validations Do Not Highlight LOV Columns Do Not Highlight Limited Options “… We have plans to further extend this to support additional types of validations in future release of Application Express.”

29 Tabular Forms 4.0 - Limitations
Coding w/the Enemy: JDeveloper as PL/SQL IDE April 26, 2006 Tabular Forms Limitations No Declarative Per-Row Validation No Declarative Page Validation (ok) No Easy Reference to Tabular Form Cells Field Highlighting Only Through Declarative Validations To Code These Use: APEX_ITEM in Query APEX_APPLICATION.g_f0nn Arrays Javascript Still LOTS OF CODE! COLLABORATE ' Paper 532

30 Tabular Forms APEX 4.0+ Plus Manual Validations ~ Tightest, Less Tedious ~

31 Manual Tabular Forms - Possibilities
Highlight Rows Disable Columns Custom Validations Row-level, Page-level, Complex Whatever You Can Code Second Tabular Form on page Whatever You Can Code!

32 Generated Item Names Each Item has a Handle Handle  
per Wizard’s Standard Naming Convention Per APEX_ITEM Call Handle   APEX_APPLICATION.g_fxx Array

33 WebDeveloper Show ID & Class Details

34 Manual Tabular Forms User APEX_ITEM in Query to Build Element
Embed JavaScript in the APEX_ITEM call Use APEX_APPLICATION.g_f0nn Arrays to Code Custom Validations, Other Processing Essentially, you are Manipulating Arrays …

35 SQL for Manual Tabular Form:
Regular SQL Query

36 Manual SQL for Tabular Form

37 Resulting Item Names

38 APEX_ITEM.TEXT Call Syntax:

39 APEX_ITEM.TEXT Example

40 APEX_ITEM.TEXT - Sorting

41 APEX_ITEM.MD5 - Checksum
Use When Need Checksum Use for Has Row Changed Checks

42

43 APEX_APPLICATION.g_fXX Arrays

44 PL/SQL to Process Manual Tab Form
Use APEX_APPLICATION.g_f0n arrays to Process Data Example: Landed Lbs Must = Landed Qty If Unit = ‘LB’

45 Landed Lbs Must = Landed Qty If Unit = ‘LB’
Pseudocode: IF g_f13=‘LB’ THEN IF g_f11 <> g_f12 THEN .. ‘Landed Lbs must match Landed Qty when Unit is LB’; END IF;

46 The Real Code – Assessment Form Validation
DECLARE v_msg VARCHAR2(4000) := ' '; v_br VARCHAR2(6) := '<br>'; BEGIN FOR i IN 1 .. APEX_APPLICATION.g_f11.COUNT LOOP IF APEX_APPLICATION.g_f13(i) = 'LB' THEN IF APEX_APPLICATION.g_f11(i) <> APEX_APPLICATION.g_f12(i) THEN v_msg := v_msg ||'Row '||TO_CHAR(i) ||‘ - Landed Lbs must equal Landed Qty if unit is LBs‘ ||v_br; END IF; END LOOP; RETURN v_msg; END

47

48 Tabular Forms – Workarounds
Manual Tabular Forms APEX_ITEM to build query, APEX g_f0nn arrays Validations not covered by APEX By-Row Validations Embed JavaScript for all those extras: Highlighting Cascading LOVs Conditional Validations Development Framework (ex: APEXLib - Tab form help for < APEX 4.0) Still LOTS OF CODE!!!

49 Manual Tabular Forms - Possibilities
Highlight Rows Disable Columns Custom Validations Row-level, Page-level, Complex Whatever You Can Code Second Tabular Form on page Whatever You Can Code!

50 Tabular Form - Manual Manual Tabular Form Using APEX_ITEM

51

52 Manual Tab Form Processing Has the Row Changed?

53 Tabular Form - Online Examples
Great Examples at Denes Kubicek Many others out there!

54 Manual Tabular Forms Demo ~ in case I forgot ~

55 Tight Tabular Forms - Summary
<= APEX 3.2 No Validations Anything can get in APEX 4.0 + Out-of-the-Box Validations Improves Still only part way there! Unless You Build It … Be Prepared to Code, Still …

56 References APEX_ITEM Documentation APEX_APPLICATION Documentation
APEX_APPLICATION Documentation APEX Documentation and Examples Denes Kubicek (Tabular Form Examples) APEXLib (Tabular Form Help)

57 K’Scope 2011!!

58 Share Your Knowledge ! Call for Articles/Reviewers
ODTUG Technical Journal ALWAYS Looking for Content!

59 Please fill out the evaluations!
Questions ? Tight Tabular Forms Please fill out the evaluations!

60 Please fill out the evaluations!
Tight Tabular Forms February 2011 Thank You ~ Tight Tabular Forms Please fill out the evaluations! RMOUG Karne Cannell, THTechnoloy

61 <= 3.2 Tabular Form - Drawbacks
Limited Validations on Columns No Row-Changed Function Error Messages Do Not Indicate Row/Column Stops After First Error To Code Validations, use APEX_APPLICATION.g_fxx Arrays All Custom Code If Order Changes, Re-Code Conditions Change g_fxx Array Checkbox Columns Use g_fxx Arrays Differently

62 Tabular Form - Manual Manual Tabular Form Using APEX_ITEM

63


Download ppt "Karen Cannell kcannell@thtechnology.com APEX: Tight Tabular Forms Karen Cannell kcannell@thtechnology.com http://www.thtechnology.com."

Similar presentations


Ads by Google