APEX Interactive Grid: JavaScript Basics Cheat Sheet

APEX Interactive Grid can be customized by JavaScript in the Advanced –> JavaScript Code attribute of the Grid or a Grid column.  Yup – JavaScript.

JavaScript may be out of the comfort zone for PL/SQL developers, even those who implemented extensive tabular form customization working with PL/SQL collections.  Time to say Goodbye to those collections … Welcome JavaScript!

The following is a collection of simple JavaScript lines most likely to be needed by a developer wanting to customize an Interactive Grid, or access data elements in the Grid.

This is not a comprehensive list or a complete function – just a simple collection of lines to give you an idea of the process and examples of  – a reference for – the syntax.

JSRefLines

Taken line by line:

var $te = $(this.triggeringElement);

This line gets the triggering element – the element that caused the dynamic action (DA) to fire. Usually we want to do this in a Grid to get the value of a particular cell – the one clicked on in this case. To get the value of the cell, we need to know which row id,  then we can narrow things down to a column using the column static id.

To get the row id, we start with the triggering element.

Next, we find the closest row – a ‘tr’ – and get the “id” data from it.  It helps to know that Interactive Grid has an “id” data element on each row:

closestTrDataId

var rowId = $te.closest('tr').data('id');

If our data element was data-thingamajig, we would access it via

 ... .data('thingamajig');

The next line gets the grid widget. The apex.region function is the preferred way to access region widgets.  “grid_static_id” is the Static ID of the Interactive Grid, set by the developer in the Advanced –> Static Id attribute of the Grid.  If you do not set one, a static id gets assigned, but it will be a long difficult-to-read identifier – it is much easier and better practice to set a meaningful static id, then use that meaningful static id in your code.

var ig$ = apex.region("grid_static_id").widget();

Given the Grid, we can now get the data model.  The data set is referred to as a data model.  There is a data model for every view:  grid,  chart, group by, icon, detail.  The following line gets the grid data model.

var model = ig$.interactiveGrid("getViews", "grid").model;

Given the grid data model, which we know is a table, we can get the record of the model, using our rowId which we identified via properties of the triggering element.

var record = model.getRecord(rowId);

Once we have the record,  we can access properties of any column in our Grid – any column in that record, using the column name – or the aliased name we assigned to the column.  Here my column name is COMM for commission.

var comm = model.getValue( record, "COMM");

model.getValue gives us the value of a cell in a record.  The corresponding model.setValue sets the value of a cell in a record.

if (comm < 100) { 
  model.setValue(record,"RIFF",'Y');
}

The above examples are easy on purpose. In fact, I bet any PL/SQL developer could follow these lines without headache.

Now you know how to access a row id, access the grid widget, access the data model of a grid, access rows – records – in that data model, and how to get and set values of the columns in that data model record.  That covers most of the basics!

You will need to learn more if you plan on complex customization or perhaps on building plugins.  For now, I recommend examining the grid in the Console, and reading the APEX widget js files.  Looking forward to APEX 5.2 (Oracle Safe Harbor), there may be documentation for all the Interactive Grid widget APIs.  Won’t that be nice!

Happy coding!

I highly recommend reviewing all of the examples in the Sample Interactive Grid packaged application.  And, read John Snyders’ hardlikesoftware.com blog posts on How to Hack the Interactive Grid.

 

Going to the Grid: What the APEX Interactive Grid Means to You and Your End Users

I will be speaking at Kscope 17 in San Antonio, TX on APEX 5.1 Interactive Grid:

Going to the Grid: What the APEX 5.1 Interactive Grid Means for You and Your End Users

Karen Cannell , TH Technology
When: Jun 26, 2017, Monday Session 2 , 11:45 am – 12:45 pm
Room: Cibolo Canyon 5
KScope_Pic
Topic: Application Express – Subtopic: APEX New Release

The long-awaited APEX 5.1 Interactive Grid region is here – but what does it mean to you and your end users? Need some practical guidance on when, why, and how to adopt the interactive grid region type? This session is for those who have seen the introductory demonstrations, are looking to upgrade to APEX 5.1, and need some advice. Does the interactive grid replace interactive reports? No more tabular forms? This session answers practical functional and technical questions raised by this new region type:

• When and why should I upgrade existing regions to interactive grid?
• Is there an upgrade wizard?
• What features will I gain; what features will I lose?
• What about customizations – will they upgrade?
• How does an editable interactive grid compare to my existing tabular form?
• Which features must still be manually written? Do I still need to write all that collection logic?
• How can I customize appearance?
• How can I add dynamic actions?
• Can I extend the interactive grid functionality?
• Will my end users like it? What about data entry users?

This session compares and contrasts interactive grids with the interactive reports and tabular forms we are familiar with. We will pay particular attention to maintaining or replacing features and common customizations in existing applications: checkboxes, 32K limits, cascading select lists, row-level validations, interactions between columns, and navigation between fields. How does the interactive grid region measure up? Should you upgrade all your interactive reports and tabular forms now?

How we do settings of which features are on or off for a particular Grid and for a particular column is now controlled by javascript. Sound scary? It is really not, you just need to learn where to put what piece of code when.  How to access data in the Grid data model?  We will show you that too.

If you cannot attend, don’t worry, I will be posting bits of that presentation here over the next few weeks.  IF you can attend, I will see you there!

Rest up ~ our Kscope 17 schedule is packed, so don’t expect much sleep or downtime.

Last Day! ODTUG Innovation Award

June 2nd is the LAST DAY for ODTUG Innovation Award nominations.

Make your nomination for the latest, greatest piece of awe-inspiring work using Oracle development technologies today.

It’s simple, go to the ODTUG Innovation Award Nomination page. Tell us about your nominee – or nominate yourself!  Everyone is eligible – make your entry today.

Is is a Cloud hybrid?  An APEX plugin? An open-source project that leverages Oracle tools?  A real clever in-house application of  Oracle JET? A really neat product from Oracle?  Anything goes!

Today is the last chance  to make your 2017 nomination.

The ODTUG Innovation Award honors excellence in creative, effective, and innovative use of Oracle development tools within ODTUG’s supported communities (ADF, APEX, BI, Database, EPM and Career). The goal is to honor developers – individuals or teams – whose passion and creativity shine through in their application of Oracle technology to address real-world problems.  Note that this year we are not excluding anything or anyone, so projects and individuals from all organizations (Oracle, too!) are welcome.

Remember that ODTUG members get to vote this year.  Make your nomination, then vote for it too! Member voting will be combined with judges scoring to determine an overall Innovation Award winner.

Check out the full information on the ODTUG web site here:

ODTUG Innovation Award Nominations

Best wishes to all our nominees!

 

ODTUG Innovation Award ~ Make Your Nomination Now!

Nominations for the 2017 ODTUG Innovation Award are open now through June 2nd.  Make your nomination now, before your Memorial Day weekend.

We are looking for innovative, exceptional, ahead-of-the-curve applications of Oracle development tools that stand out as examples of “the next big thing”, or maybe the really neat next small thing,  in Oracle technology.   Can’t think of anything? Nah, I don’t believe that.  Consider:

  • Do  you have, or does your co-worker have an unusually creative application or combination of new and emerging Oracle tools?
  • Did you find a new open source project that makes your life easier?  Open source projects are eligible, as long as they integrate some Oracle technology.
  • Does your latest project enable faster, smoother, cleaner adoption of an Oracle tool?
  • Are you envying someone else’s work, saying “Wish I thought of that …”?
  • Have you seen a real neat learning tool that aids others in understanding a new Oracle tool?   All projects, large and small, are eligible.
  • Does your organization have an exception program for attracting or training persons new to Oracle technology?
  • Have you created, seen or adopted a new plugin or feature, large or small, that others may not have seen yet?

We are looking for the stuff that makes you say “Wow, great idea …”  or “Neat stuff …” or “wicked cool …” (you can tell where I am from).  We need your help to get as many innovation examples in before the June 2nd deadline.

Now is the time to make your nomination.

The ODTUG Innovation Award honors excellence in creative, effective, and innovative use of Oracle development tools within ODTUG’s supported communities (ADF, APEX, BI, Database, EPM and Career). The goal is to honor developers – individuals or teams – whose passion and creativity shine through in their application of Oracle technology to address real-world problems.  Note that this year we are not excluding anything or anyone, so projects and individuals from all organizations (Oracle, too!) are welcome.

Note that ODTUG members get to vote this year.  Make your nomination, then vote for it too! Member voting will be combined with judges scoring to determine an overall Innovation Award winner.

Check out the full information on the ODTUG web site here:

ODTUG Innovation Award Nominations

Nominations close June 2nd, so act soon!

ODTUG Innovation Award 2017 ~ Nominations are Open!

Nominations for the 2nd Annual ODTUG Innovation Award are now open!

The ODTUG Innovation Award honors excellence in creative, effective, and innovative use of Oracle development tools within ODTUG’s supported communities (ADF, APEX, BI, Database, EPM and Career). The goal is to honor developers – individuals or teams – whose passion and creativity shine through in their application of Oracle technology to address real-world problems.

We are looking for innovative, exceptional, ahead-of-the-curve applications of Oracle development tools that stand out as examples of “the next big thing” in Oracle technology or as unusually creative applications of new and emerging Oracle tools.  The stuff that makes you say “Wow, great idea …”  or “Neat stuff …” or whatever rad saying you use.

Now is the time to make your nomination.

What is it this year: A new Cloud implementation?  A clever APEX integration? A cross-platform collaboration?  The sky (cloud joke) is not the limit!

New this year is Member Voting – all ODTUG members are invited to vote for your favorite Innovation Award nomination. Yes,  we want YOU to help decide the 2017 Innovation Award winner. Member voting will be combined with judges scoring to determine an overall Innovation Award winner.

Check out the full information on the ODTUG web site here: ODTUG Innovation Award Nominations

Nominations close June 2nd, so act soon!

ODTUG

The 2017 ODTUG Innovation Award nominations will be reviewed by a team of judges according to these general topics:

  • Innovation – The “wow” factor: acknowledges the exceptional and innovative
  • Quality – Not only does it have to be “wow,” but it has to work
  • Applicability – Evaluates subject matter importance, completeness, effectiveness, and accuracy
  • Topic merit – Treatment of a cutting-edge topic, technical complexity, or new and unique approach to a common problem

Judges score will be combined with member voting results to determine the overall winner.

For guidance, a perfect example of innovation with Oracle tools is our 2016 Innovation Award Winner: Mia Urman, AuraPlayer 

AuraPlayer and Oracle joined forces to mobilize the Oracle Forms based collision reporting system for the New York MTA to a new Oracle Mobile Cloud based application without redevelopment. In the past, MTA’s officers had to manually fill out accident reports in the field and then deliver it to a data entry clerk who would then enter the information into MTA’s legacy system.  Using AuraPlayer and Oracle’s Mobile cloud they were able to create a “mobile-ready” version of the application without the need for redevelopment or migration of the underlying Oracle Forms system. To enable this modernization, REST services were automatically generated from the Oracle Forms business processes using AuraPlayer. The REST services communicate with the Oracle Mobile Cloud Service, enabling authentication and push notifications, as well as application monitoring and analytics.

Using this application, MTA employees are now able to gather collision information and in addition, now capture photos of the accidents and documents on their tablets.  This data is automatically updated by AuraPlayer into MTA’s Oracle Forms system.  The mobile app also works offline, even without cell or Wi-Fi coverage, this is especially important when an officer is working in a tunnel or on the middle of a bridge. With the real-time submission of traffic accident reports, MTA can assess damages much quicker, determine if a crew is needed to repair damage, and clear the scene in much shorter time—in some cases minutes, instead of hours. The need to manually type collision reports after the fact was eliminated, and the efficiency, accuracy, and timeliness of the data were improved.

See more about AuraPlayer here.

Congratulations, Mia and AuraPlayer!

 

APEX 5 IR Guts and Performance

APEX 5 Interactive Reports (IR) are powerful out of the box, but one can significantly improve performance by strategic settings of certain key parameters.  The full presentation covers all the options.

When your data volumes are low to medium, there may not be much noticeable difference. But when data volumes are high, or the query is resource intensive, the following advice and settings can have a significant performance impact.

In brief:

  • Tune your query, then fine-tune your SQL query. Any slowness here will be magnified in APEX
  • Check MAXROWCOUNT.   The more rows, the longer it takes APEX to retrieve them.  do users really need ALL the rows? OR is it reasonable to ask users to filter first. (APEX 5.1 Interactive Grid will include features to FORCE users to filter first – nice!) Consider  supplying users who need to Download All a separate pag,e os not all users are handicapped by a high MAXROWCOUNT value.
  • Check Max Rows Per Page
  • Check your Pagination setting.  The X to Y of Z is popular, but the “of Z” part is expensive – APEX needs to retrieve all rows then set up pagination. That All Rows part takes time.  Consider using X to Y, and adding a page item that calculates the Z separately. (THere are various options to do this, a topic for another blog post, ranging from a straight COUNT(*) to a sophistcated use of APEX_IR to get the count of the as-filtered IR query)

These are your big-impact settings.

For more info, see the full presentation via the link below or Slideshare:

As you move to APEX 5 Interactive Grid, these three settings till apply – but you have better pagination options, and pagination works differently – heck, all of Interactive Grid works differently – better!  So watch here for upcoming information on Interactive Grid.

APEX5 IR Guts and Performance

Smart use of the IR settings makes for a better end user experience ~ and that’s the whole point!

Announcing the ODTUG Innovation Award

What Oracle development project in the past year made you say WOW!

What project, collaborative or individual, demonstrates exceptionally innovative and creative use of Oracle technology?

What stands out as an above-and-beyond example of Oracle technology applied to real world problems? 

To honor such creativity and innovation, ODTUG announces a more modern mode of honoring excellence within ODTUG’s supported communities (ADF, APEX, BI, Database, and EPM), the ODTUG Innovation Award.

The ODTUG Innovation Award honors excellence in creative, effective, innovative use of Oracle development tools. The goal is to honor developers – individuals or teams – whose passion and creativity shines through in their application of Oracle technology to address real world problems in our ODTUG communities.

communites

We are looking for innovative, exceptional ahead-of-the-curve applications of Oracle development tools that stand out as examples of “the next big thing” in Oracle technology, or as unusually creative applications of new and emerging Oracle tools in our ODTUG communities.

To make a nomination for the award, you must be an ODTUG member (Associate or Full). If you are not a member, join ODTUG now.

Who/What is Eligible:

  • Nominees may be individuals or teams that are non-Oracle employees.
  • Nominees need not be ODTUG members, but they must work with a tool that supports at least one of our communities (ADF, APEX, BI, Database, and EPM).
  • Open Source and / or collaborate efforts are eligible.

Nominations:

  • Nominations Open: Now!
  • Nominations Close: May 31st

More information:

What we are looking for are the things that make us go Wow! when we first see them.  Here are a few historical examples:

  • Integration of Oracle Forms and Java ADF (years ago)
  • HTMLDB, when it first came out – and the first practical applications of HTMLDB (years ago)
  • Oracle-based applications on an iPhone
  • Oracle applications of Google Glasses
  • Our first look at Node.js integrated with (extending) an APEX application. (a few years back)
  • Peter Koletzke and Paul Dorsey’s work deciphering and promoting JDeveloper when it first launched

We know sure there are examples from every Oracle technology community. ~ let us know about them!

Judging:

The 2016 ODTUG Innovation Award winner will be decided by a team of ODTUG experts who will review all of the nominations and discuss and rate them according to these general topics:

Innovation – The Wow factor: Acknowledges the exceptional and innovative
Quality – Not only does it have to be Wow, it has to work.
Applicability – Evaluates subject matter importance, completeness, effectiveness, and accuracy
Topic Merit – Treatment of a cutting-edge topic, technical complexity, or a new and unique approach to a common problem.

For this first year, the  ODTUG Innovation Award will be awarded decided by a select panel of experts from across all ODTUG communities. In future years, nominations will be open all year long, and all ODTUG members will be able to vote for their favorite.

Watch for more information on the  ODTUG Innovation Award on all the usual channels: ODTUG emails, Twitter, the ODTUG website,

Our ODTUG Innovation Award honors innovation, excellence and amazing accomplishment in the realm of Oracle Development Tools adoption and integration.   The possibilities are endless ~ What makes you, as a developer, say Wow! ~ Nominate your favorite examples now!

 

ODTUG Board of Directors Election ~ Vote!

Vote for the ODTUG Board

The ODTUG Board of Directors election is underway now.  ODTUG memebers, this is your chance to choose 5 new board members for the 2016-2017 term.

Again this year there is a stellar selection of candidates.

Why do I run?  I have served ODTUG in many capacities behinds the scenes and as Editor of the Technical Journal, and want to :

  • Bring more quality learning material in all formats, online and offlne, to all Oracle developers:
    • more online material in more formats, and
    • more meetups to bring the message local.
  • Encourage women in technical fields:
    • to strive for higher positions in those careers, and
    • to have greater confidence in what they bring to the table technically and personally.
  • Strengthen the ODTUG Communities so that material and answers from ODTUG experts shows up in every search. We cannot keep our knowledge behind (fire)walls!

ODTUG should be the Oracle Developer go-to resource for learning, online and locally.  As a board member I will work to increase ODTUG’s online presence and increase ODTUG’s regional and local presence via co-hosted meetups.

There are many qualified candidates – regardless of who you vote for, VOTE!

Read all the campaign statements and biographies of the candidates.

ODTUG is the best source of learning for all Oracle development tools ~ your vote ensures we not only stay that way but grow as fast or faster as the tools we use.

To vote, please visit https://www.associationvoting.com/odtug and enter your email and Voter ID exactly as shown in the email you received from ODTUG (actually from announcement@associationvotiing.com) on or about 10/06/2015.

Not a member? Join!  You are missing out on the best Oracle training in the world, at minimal investment of a year’s membership fee. Betteryet, VOLUNTEER and quadruple the learning advantage.

As always, Happy Coding!

BTW ~ Accepting Viedos, Blog Posts, papers, podcasts – send us your excellence for publication in the ODTUG Technical Journal.

Karen

ODTUG Technical Journal Corner

ODTUG Technical Journal – submit papers now!

2015 ODTUG Kscope Editor’s Choice Award – Calling All Minds, Calling All Media

It’s that time of year again – for the ODTUG Editor’s Choice Awards. This year we welcome submissions in all media – even online annotated demos. Shows us your stuff – wow us with your brilliance and clever use of Oracle development tools!

Hello, ODTUG!

Spring is here – finally – and that means ODTUG KScope Editor’s Choice Award submissions are open,

The annual ODTUG Editor’s Choice Award honors excellence in creative, effective use of all modern media options to convey a complete technical topic to our members. Every Kscope presenter is eligible.

2015 is again an all-media year. The popularity of blogs, videos, and podcasts provest hat today’s developers gather and share information in a wide variety of media. ODTUG members consume information online and in various media formats, in addition to formal white papers and printed textbooks. Some say the white paper is dead; others simply save trees and present and consume all their technical content online. We are with you.

ODTUG’s aim is to deliver quality, timely technical content to our members in the most convenient online formats possible – and we want to keep that momentum going. Two years ago, our Technical Journal transitioned to an entirely online format. Accordingly, we have made the same transition with our Kscope conference materials.

We ask our Kscope speakers to submit both their presentation slides (mandatory) and an alternate media technical submission (optional) that covers their presentation topic. The additional, non-PowerPoint submission is eligible for the Editor’s Choice Award. The Editor’s Choice submission may be in any combination of the media types: video, audio file, blog post, online demonstration, white paper or whatever, as long as we can reuse it in our online Technical Journal. Entries should convey a complete technical topic, the topic of the speaker’s presentation.

All conference materials are eventually available to our members. The purpose of our all-media expansion is two-fold. Accepting speaker presentation submissions in reusable media types:

  • Increases the volume and variety of technical material available to our members
  • Expands the ODTUG Editor’s Choice Award to acknowledge creative, effective use of all modern media options to convey a complete technical topic, not just white papers

Our Editor’s Choice Award honors excellence in conveying a complete technical topic to our members. The Editor’s Choice Award winner is decided by a team of ODTUG experts who review all of the conference submissions and grade them according to these general topics:

  • Communication Quality – assesses communication style (written or verbal), overall organization of the media, and grammar
  • Applicability – evaluates subject matter importance, completeness, effectiveness, and accuracy
  • Topic Merit – acknowledges the exceptional and innovative, treatment of a cutting-edge topic, technical complexity, or a new and unique approach to a common problem

Most important for the Editor’s Choice Award is overall excellence in technical communication of complete technical topic for our ODTUG members. Grammar, organization, proper formatting (for the media type), clarity, examples appropriate for the content, and how well the message is conveyed all matter more than the media type. The overall goal is to deliver great content to our members.

By the way – no tweets allowed! Our ODTUG members are smart and eager to learn; they are hungry for more than a tweet. As a technical editor, I believe our members deserve more than 140 characters.

We are also accepting nominations for our Editor’s Choice Review Team. This dedicated team of volunteers reviews each conference submission according to published scoring criteria. The scores are weighted and averaged to arrive at an overall winner. Our review team is comprised of a cross-section of our members – no one developer tool or technical topic is overly weighted or favored. We are always looking for new Editor’s Choice Team members. To join us, or to nominate someone else, please contact me at kcannell@odtug.com. This is an easy way to volunteer for ODTUG and get a pre-conference view of all Kscope conference material. It’s like a conference before the conference.

So, Kscope presenters – WOW US with your stuff! The door is open – show us what you know, in your favorite media. I thank you in advance, from all our ODTUG members.

As always, happy coding,

Karen

 

Vote for the ODTUG Board!

 ODTUGatOOW

Voting for the ODTUG Board of Directors is now open, and this year brings an amazing list of candidates yours truly included.

I believe ODTUG is and should continue to be THE center of excellence for Oracle Developers – we do that through attracting and maintaining quality members, quality material and expert technical information in all media types, all through the work of our awesome volunteers. Social media and limited budgets bring opportunity and challenges to ensuring all our members have access to all our materials, not just those fortunate enough to attend KScope.  

I have been a member and volunteer for ODTUG since 2007, Editor of the ODTUG Technical Journal since 2008. Prior to that a member and volunteer for IOUG, Contributing Editor for the IOUG Select Journal. I have served on conference review teams, Editor’s Coice Award teams, speaker, ambassador, and in whatever other capacity is needed.  I want ODTUG to always be there when the next Oracle developer needs help and advice. 

Check out all the candidate statements here, and cast your vote to help ensure a strong and growing future for ODTUG.  Votes for Karen Cannell are much appreciated!

You must be an ODTUG member to vote, and if you are not already a member, I encourage you to join. Our user group is truly a fantastic source of technical material and side-by-side networking with the experts across the full suite of Oracle development tools. 

If you are an Oracle developer, ODTUG can help get you and keep you up-to-speed on the latest Oracle technology. And have fun and meet great people along the way.

 ODTUGatOOW