Wednesday, November 30, 2011

Min and Max Dates in APEX

APEX 4.0 introduced native support for the jQuery UI Date Picker. When you create a date item in APEX you now have the option to set a Minimum and Maximum date as shown below. The catch is that those dates restrictions are defined when the page is rendered and aren't updated in real time. This is an issue if you want those constraints to dynamically change based on user input.

Date Picker Settings

In some cases you'll need the min and max dates to change dynamically. A classic example is when you book a plane ticket and set your departure and return dates. When you select a departure date then select a return date, the return date can't be before the departure date. Dates before the departure date are usually greyed out. Using APEX you could try to implement this example by doing the following:

- Create a Date Item, P1_DEPT_DATE. Set the Maxium Date to be &P1_RETURN_DATE.
- Create a Date Item, P1_RETURN_DATE. Set the Mininum Date to be &P1_DEPT_DATE.

Run the page and select a date for the Departure Date (in this example 24-Nov-11). Next, select a Return Date. You'll notice that the calendar picker does not prevent you from selecting a return date before 24-Nov-2011.



Note: If you submit the page now it'll raise an exception since the Min and Max attributes requires the date to be in YYYYMMDDHH24MI format. 

So how do you have the min and max date restrictions change based on the user input? Excellent question. My next post introduces a plugin that resolves this issue.

Tuesday, November 29, 2011

ClariFit Dialog Plugin

Over a year ago I released the ClariFit Simple Modal plugin. Since it's inception it's been downloaded almost 5000 times and has been used in several production applications (that I know of).

Today I'm please to release an "updated" version of plugin called ClariFit Dialog plugin. Like the Simple Modal plugin, the Dialog plugin is a dynamic action and allows you to have a modal or dialog window. It also has a lot of new features (listed below). Going forward if you're going to use a modal/dialog window plug-in I recommend using the ClariFit Dialog plugin.

A demo is available on plugins.clarifit.com and it can be downloaded from apex-plugin.com.

ClariFit Dialog Plugin Settings
List of features:
  • Uses the jQuery UI dialog code and leverages the jQuery UI theme currently incorporated in your APEX application.
  • Support for open/close directly in same plugin.
  • Option to have either a modal or dialog window.
  • Hide affected elements on page load. If set, this option will hide the region after the page is loaded. This removes the need to have separate region templates.
  • Chose visible state of the modal window after it's closed.

Remainder of 2011

Dear Readers,

It's been a while (over 4 months) since I've posted a technical article on this blog. After presenting at ODTUG KScope this summer I've been really busy working at ClariFit and with other commitments. During the past four months there have been many times where I would have loved to roll up my sleeves and write a few articles but unfortunately other priorities took over.

The rest of my 2011 calendar is filling up quickly and I hope to squeeze in a few more articles by the end of the year. Here's what you can expect for the remainder of 2011: 
  • Free Ask the ClariFit Experts Webinar on Wednesday December 14th at 1:30 PM EST. Note: it's still not to late to submit an APEX or PL/SQL question. Check the link for more info on how to submit questions and register.
  • Two free plug-ins to be launched this week (actually one will be today!)
  • Guest blog post on All Things Oracle about the Expert Oracle Application Express Plugins book.
  • Last but not least, (time permitting of course) a few APEX related articles. I have a very large list to write about and really look forward to dig into them.

 - Martin

Tuesday, November 15, 2011

Ask the ClariFit Experts Webinar

On December 14th at 1:30 PM EST Chris Hritzuk and I will be taking part in an “Ask the ClariFit Experts” webinar hosted by my company, ClariFit Inc. Leading up to the webinar the development team at ClariFit will be accepting APEX, SQL, and PL/SQL questions by email at AskTheExperts@clarifit.com. The plan is to choose a subset of questions from the list received and provide a live, step-by-step demonstration of the solution during the webinar. We’ll also be leaving some time at the end of the session to field any questions that come up during the webinar.

To find out more about the webinar, including how to sign up, click here: http://www.clarifit.com/1/post/2011/11/ask-the-clarifit-experts-webinar.html