<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jeff Holoman's Blog</title>
	<atom:link href="http://jholoman.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jholoman.wordpress.com</link>
	<description>Mostly Oracle, APEX and other stuff</description>
	<lastBuildDate>Sun, 10 Jan 2010 14:11:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jholoman.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jeff Holoman's Blog</title>
		<link>http://jholoman.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jholoman.wordpress.com/osd.xml" title="Jeff Holoman&#039;s Blog" />
	<atom:link rel='hub' href='http://jholoman.wordpress.com/?pushpress=hub'/>
		<item>
		<title>jsTree and APEX</title>
		<link>http://jholoman.wordpress.com/2010/01/09/jstree-and-apex/</link>
		<comments>http://jholoman.wordpress.com/2010/01/09/jstree-and-apex/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 01:23:35 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[APEX]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=100</guid>
		<description><![CDATA[I&#8217;ve had this post sitting here as a draft since August 4th, but with the arrival of our first son back in June, Ive been a little slow to blog. I was checking out the new early Adopters version of Apex 4.0 and saw the cool tree interface for the app builder. It reminded me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=100&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;ve had this post sitting here as a draft since August 4th, but with the arrival of our first son back in June, Ive been a little slow to blog. I was checking out the new early Adopters version of Apex 4.0 and saw the cool tree interface for the app builder. It reminded me of this post. Another reason for not posting was that a new version had been released for jstree with some changes, and I hadn&#8217;t had time to make the necessary revisions.</em></p>
<p>I&#8217;ve never really used the built in APEX trees, but I had a need to display some hierarchical data and wanted some added functionality over what the built in apex trees provide. I went out looking for interesting JQuery plugins. The one I settled upon was <a href="http://www.jstree.com/">JSTree </a>. I like that it has a customizable context menu among other things.  Well this is just an example and can be made more generic&#8230;I&#8217;ve hard-coded a couple of things for the purposes of this demo but this should get you started. Here&#8217;s the demo: <a href="http://tryapexnow.com/apex/f?p=9155:2">http://tryapexnow.com/apex/f?p=9155:2</a></p>
<p>For this example I am organizing different types of samples in a case. Here are the tables.</p>
<pre class="brush: sql;">
SQL&gt; desc sample_types;
  ID                                        NOT NULL NUMBER(38)
 DESCRIPTION                                        VARCHAR2(50)
 ...
 TREE_IMAGE                                         VARCHAR2(250)

SQL&gt; desc samples;

ID                                        NOT NULL NUMBER(38)
CASE_ID                                   NOT NULL NUMBER(38)
SAMPLE_TYPE_ID                            NOT NULL NUMBER(38)
...
PARENT_ID                                          NUMBER(38)

SQL&gt; SELECT s.id, s.parent_id, level
      FROM samples s
      WHERE case_id = :CASE_ID
      START WITH parent_id = 0
      CONNECT BY PRIOR s.id = s.parent_id;

        ID  PARENT_ID      LEVEL
---------- ---------- ----------
      1067          0          1
      1068       1067          2
      1076       1068          3
      1071       1067          2
      1077       1071          3
      1078       1077          4
      1073       1067          2
      1072          0          1

8 rows selected.
</pre>
<p>Note that I made all parent samples have a parent_id of zero.</p>
<p>The author of JSTree <a href="http://vakata.com/en/">Ivan Bozhanov</a> has done a great job with providing both documentation and examples of how to setup the tree component.</p>
<p>Among the choices of data source, I chose to implement the source as a JSON object, and I wrote a function to output my connect by query in the format that jsTree expects.</p>
<pre class="brush: sql;">
create or replace function get_samples_tree(p_case_id_in cases.id%TYPE) RETURN VARCHAR2 AS
      l_json         VARCHAR2(32767);
      l_loop_counter NUMBER(5);
   BEGIN
      l_json := '[';
      FOR i IN (SELECT rownum,
                       s.id,
                       s.parent_id,
                       LEVEL,
                       lead(LEVEL, 1, 0) over(ORDER BY rownum) lead,
                       st.tree_image,
                       st.id type_id
                  FROM samples s, sample_types st
                 WHERE case_id = p_case_id_in
                   AND s.sample_type_id = st.id
                 START WITH parent_id = 0
                CONNECT BY PRIOR s.id = s.parent_id)
      LOOP
         l_json := l_json || '{ &quot;attributes&quot;: ';
         l_json := l_json || '{ &quot;id&quot; : ';
         l_json := l_json || '&quot;stree_' || i.id || '&quot;';
         l_json := l_json || ', &quot;rel&quot; : ';
         l_json := l_json || '&quot;' || i.type_id || '&quot;';
         l_json := l_json || '}, ';
         l_json := l_json || '&quot;data&quot;:{ &quot;title&quot; : &quot;';
         l_json := l_json || i.id || '&quot;, &quot;icon&quot; : &quot;/i/' || i.tree_image ||
                   '&quot;, &quot;attributes&quot; : { &quot;href&quot; : &quot;f?p=' || v('APP_ID') ||
                   ':3:' || v('APP_SESSION') ||
                   '::NO::P3_SAMPLE_ID:'|| i.id ||
                   '&quot; }}';
         --  l_loop_counter := i.LEVEL - i.lead;

         IF i.lead &gt; i.LEVEL
         THEN
            l_json := l_json || ', &quot;children&quot;: [ ';
         ELSE
            l_json := l_json || '},';
         END IF;
         IF i.lead &lt; i.LEVEL
         THEN
            l_loop_counter := i.LEVEL - i.lead;
            FOR j IN 1 .. l_loop_counter
            LOOP
               l_json := TRIM(trailing ',' FROM l_json);
               l_json := l_json || ' ] ';
               IF (i.lead &lt;&gt; 0 OR j &lt;&gt; l_loop_counter)
               THEN
                  l_json := l_json || '},';
               END IF;
            END LOOP;
         END IF;
      END LOOP;

      RETURN l_json;
   EXCEPTION
      WHEN OTHERS THEN
         RAISE;
   END get_samples_tree;
</pre>
<p>The on-demand process is straight-forward enough:</p>
<pre class="brush: sql;">
declare
l_tree varchar2(32767);
begin
l_tree := get_samples_tree(wwv_flow.g_x01);
htp.prn(l_tree);
end;
</pre>
<p>jsTree is quite flexible. In the javascript below, I&#8217;m using asynchronous json to get the data. In order to pass the values to the URL in the data.opts section, you use the callback &#8220;beforedata&#8221;</p>
<pre class="brush: jscript;">
function populateSamplesTree(pCaseId, pRegionId) {

jQuery(&quot;#&quot;+pRegionId).tree({
    data  : {
    type  : &quot;json&quot;,
    async : true,
    opts  : {
       method: &quot;POST&quot; ,
url:&quot;wwv_flow.show&quot;
	    }
	 },
  callback : {
  onchange : function (NODE,TREE_OBJ) {
  document.location.href = $(NODE).children(&quot;a:eq(0)&quot;).attr(&quot;href&quot;); },
  beforedata : function(NODE, TREE_OBJ) {
       return {
        p_flow_id:jQuery('#pFlowId').val(),
        p_flow_step_id:jQuery('#pFlowStepId').val(),
        p_instance:jQuery('#pInstance').val(),
        x01:$v(pCaseId),
        p_request:&quot;APPLICATION_PROCESS=GET_SAMPLE_TREE&quot; }
     }
  }
});
//jQuery.tree.reference( pRegionId).open_all();
}
</pre>
<p>Another way to accomplish the same thing would be to use a &#8220;standard&#8221; on demand call for APEX, and parse the result as a json object. In order to do that you need the json javascript library from http://www.json.org/</p>
<pre class="brush: jscript;">
function populateSamplesTree2(pCaseId, pRegionId) {
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GET_SAMPLE_TREE', 0);
 get.addParam('x01', $v(pCaseId));
gReturn = get.get();
var jsonobj = JSON.parse(gReturn);
apex.jQuery(&quot;#&quot;+pRegionId).tree({
  data  : {
    type  : &quot;json&quot;,
    opts  : {
      static :   jsonobj }
  },
  callback : {
  onchange : function (NODE,TREE_OBJ) {
  document.location.href = $(NODE).children(&quot;a:eq(0)&quot;).attr(&quot;href&quot;);
                               }
                          }

});
}
</pre>
<p>I could store the context menu config in the database as well and generate the JSON for it, but as this is just for example, I&#8217;ve left that out.  You can easily do dynamic context menus. I&#8217;ve included the type in the tree and you can see I&#8217;ve hardcoded in Sample Type 1 in the menu option for &#8220;split&#8221;.</p>
<pre class="brush: jscript;">
function populateSamplesTree3(pCaseId, pRegionId) {
var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=GET_SAMPLE_TREE', 0);
 get.addParam('x01', $v(pCaseId));
gReturn = get.get();
var jsonobj = JSON.parse(gReturn);
apex.jQuery(&quot;#&quot;+pRegionId).tree({
  data : {
    type : &quot;json&quot;,
    opts : {
        static : jsonobj
    }
},
callback : {
    onchange : function (NODE,
    TREE_OBJ) {
        document.location.href = $(NODE).children(&quot;a:eq(0)&quot;).attr(&quot;href&quot;);
    }
},
plugins : {
    contextmenu : {
        items : {
            create : false,
            rename : false,
            remove : false,
            split : {
                label : &quot;Split&quot;,
                icon : &quot;&quot;,
                visible : function (NODE,
                TREE_OBJ) {
                    if (TREE_OBJ.get_type(NODE) != &quot;1&quot;) {
                        return -1
                    } ;
                },
                action : function (NODE,
                TREE_OBJ) {
                    // Just a demo of the arguments
alert('&quot;' + NODE.children(&quot;a&quot;).text() + '&quot; from &quot;' + TREE_OBJ.container.attr(&quot;id&quot;) + '&quot;');
                }
            },
            type_2 : {
                label : &quot;Another Type&quot;,
                icon : &quot;&quot;,
                visible : true,
                action : function (NODE,
                TREE_OBJ) {
                    // Just a demo of the arguments
alert('&quot;' + NODE.children(&quot;a&quot;).text() + '&quot; from &quot;' + TREE_OBJ.container.attr(&quot;id&quot;) + '&quot;');
                }
            }
        }
    }
}
});
}
</pre>
<p>Now I can just create the regions on the page with source of</p>
<pre class="brush: plain;">
&lt;div id=&quot;samples_tree&quot;&gt;&lt;/div&gt;

&lt;div id=&quot;samples_tree2&quot;&gt;&lt;/div&gt;

&lt;div id=&quot;samples_tree3&quot;&gt;&lt;div&gt;
</pre>
<p>Now go time:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
apex.jQuery(document).ready(function(){
   populateSamplesTree('P2_CASE_ID', 'samples_tree');
   populateSamplesTree2('P2_CASE_ID', 'samples_tree2');
populateSamplesTree3('P2_CASE_ID', 'samples_tree3');
});
&lt;/script&gt;
</pre>
<p>I&#8217;ve left out icons, which are easy to add, and a host of other things. If I ever get some more time I&#8217;d like to make this more generic and reusable.</p>
<p>Check out a demo here:<br />
<a href="http://tryapexnow.com/apex/f?p=9155:2">http://tryapexnow.com/apex/f?p=9155:2</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=100&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2010/01/09/jstree-and-apex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Wave</title>
		<link>http://jholoman.wordpress.com/2009/05/30/google-wave/</link>
		<comments>http://jholoman.wordpress.com/2009/05/30/google-wave/#comments</comments>
		<pubDate>Sat, 30 May 2009 09:40:01 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=93</guid>
		<description><![CDATA[There&#8217;s been a lot of buzz about the Google Wave unveiling. Here&#8217;s the entire presentation. Pretty cool. I&#8217;m looking forward to see this develop and perhaps find ways to integrate with APEX.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=93&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of buzz about the Google Wave unveiling.  Here&#8217;s the entire presentation.</p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/v_UyVmITiYQ?version=3&amp;rel=0&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<p>Pretty cool. I&#8217;m looking forward to see this develop and perhaps find ways to integrate with APEX.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=93&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/05/30/google-wave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Time to jQuery Datepicker</title>
		<link>http://jholoman.wordpress.com/2009/05/15/adding-time-to-jquery-datepicker/</link>
		<comments>http://jholoman.wordpress.com/2009/05/15/adding-time-to-jquery-datepicker/#comments</comments>
		<pubDate>Sat, 16 May 2009 01:37:28 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[APEX]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PL/SQL]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=42</guid>
		<description><![CDATA[A number of folks have blogged about using the jQuery datepicker in APEX. One of the redeeming qualities of the APEX datepicker widget is it&#8217;s support for a time component, which the jQuery datepicker lacks. I&#8217;m sure most of the time the ability to pick just the date is enough.  There are however times when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=42&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A number of folks have blogged about using the jQuery datepicker in APEX. One of the redeeming qualities of the APEX datepicker widget is it&#8217;s support for a time component, which the jQuery datepicker lacks. I&#8217;m sure most of the time the ability to pick just the date is enough.  There are however times when you need finer granularity.   There are some seperate timepicker plugins, but having the date/time tied to one element is more natural in relation to the standard APEX datepicker. I&#8217;m posting to share one solution, but mostly to get other ideas on the best way to handle this occasion. I like the functionality and ease of implementation of the jQuery datepicker, but I&#8217;m not crazy about the work-around shown here to handle the time.</p>
<p>Check out this small demo in action <a href="http://apex.oracle.com/pls/otn/f?p=18507:8">here</a> if you don&#8217;t want to read the whole post.</p>
<p>The <a href="http://docs.jquery.com/UI/Datepicker/formatDate">jQuery docs</a> show that you can use &#8216;&#8230;&#8217; &#8211; literal text in your format string.</p>
<p>This allows the opportunity to append a time component to the standard format mask.  The solution presented here requires the user to manually edit the time component, so in order to accommodate this, a database function is created to validate the date. This could be done of course just using JavaScript but I think using the database to do the validation is easier.</p>
<pre class="brush: sql;">
create or replace function is_date(p_date in varchar2, p_format_mask_in in varchar2)
return boolean
as
  l_date date;
  l_format_mask varchar2(50);
begin
  l_format_mask := 'fx'||p_format_mask_in;
  l_date :=  to_date(p_date, l_format_mask);
   return true;
exception when others then
  return false;
end;
</pre>
<p>An on-demand application process, VALIDATE_DATE  is created to call the validation function, along with a corresponding javascript function to call it. I kept the is_date function a separate db function instead of rolling the functionality into the app process in case I had need for it elsewhere.</p>
<pre class="brush: sql;">
declare
 l_return number(1);
 l_date varchar2(50);
begin
l_date := wwv_flow.g_x01;
 if (is_date(l_date, v('PICK_DATE_FORMAT_MASK')))
 then
  l_return := 1;
 else
  l_return := 0;
 end if;
htp.p(l_return);
end;
</pre>
<p>validateDate</p>
<pre class="brush: jscript;">function validateDate (pDate, pOraFormatMask) {
 var get = new htmldb_Get(null,$v('pFlowId'), 'APPLICATION_PROCESS=VALIDATE_DATE', 0);
 var lDate = $(pDate).val();
 get.addParam('x01', lDate);
 var gReturn = get.get();
 get = null;
 if (gReturn==0)
 {   alert('Invalid Date Format Entered.\n Dates should be in '+ pOraFormatMask +' format.'); }
}
</pre>
<p>We&#8217;ll need two application items and corresponding computations to hold the different format masks, PICK_DATE_FORMAT_MASK and JS_DATE_FORMAT_MASK.</p>
<p>The format mask I want to use for Oracle  is &#8216;YYYY-MM-DD HH24:MI&#8217;, the jQuery datepicker mask that matches that is &#8216;yy-mm-dd&#8217;, but no time component.</p>
<p>I then create a hidden item on page zero, P0_JS_SYSDATE, with a source value of:</p>
<p>to_char(sysdate, ‘&amp;PICK_DATE_FORMAT_MASK.’);</p>
<p>This will allow me to grab the time component easily for the datepicker.</p>
<p>All that&#8217;s left now is to call the the function that creates the datepicker:</p>
<pre class="brush: jscript;">
function dpWithTime(pOraFormatMask, pDpFormatMask, pSysdate) {
   var timeFormat = &quot; &quot; + pSysdate.split(&quot; &quot;)[1];
  $('fieldset[class=datepicker]').find('img').css('display','none');
    $('fieldset[class=datepicker]').find('input[type=text]').datepicker({
        dateFormat: pDpFormatMask + timeFormat,
        showOn: &quot;button&quot;,
        buttonImage: &quot;/i/asfdcldr.gif&quot;,
        buttonImageOnly: true
        }).change(function(event) {validateDate(this, pOraFormatMask)});
}
</pre>
<p>In the html header for the page, or the page template:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
var oraFormatMask = &quot;&amp;PICK_DATE_FORMAT_MASK.&quot;;
var jsFormatMask = &quot;&amp;JS_DATE_FORMAT_MASK.&quot;;
var l_sysdate =  $('#P0_JS_SYSDATE').val();
dpWithTime(oraFormatMask, jsFormatMask, l_sysdate);
});
&lt;/script&gt;
</pre>
<p>Again the example is <a href="http://apex.oracle.com/pls/otn/f?p=18507:8">here.</a></p>
<p>Let me know if you have any other ideas, like I said at the start, I&#8217;m not thrilled with this approach, but if the rest of your app is already using the jQuery datepicker, and you need one with a time component maybe this will work. Thanks to <a href="http://tylermuth.wordpress.com">Tyler Muth </a>for his earlier blog/sample app using jQuery datepicker and for the bit about using the fieldset selector which he blogged about<a href="http://tylermuth.wordpress.com/2008/12/17/jquery-selectors-will-change-your-life/"> here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=42&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/05/15/adding-time-to-jquery-datepicker/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting Video</title>
		<link>http://jholoman.wordpress.com/2009/04/09/interesting-video/</link>
		<comments>http://jholoman.wordpress.com/2009/04/09/interesting-video/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 02:06:13 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=28</guid>
		<description><![CDATA[I&#8217;m not one of those people who spends an inordinate amount of time on YouTube, but my Mom sent me a video that I thought was pretty interesting. One thing it really underscores is that staying current is very important, and as &#8220;other stuff&#8221; comes up in life, I&#8217;m making it a personal goal to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=28&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not one of those people who spends an inordinate amount of time on YouTube, but my Mom sent me a video that I thought was pretty interesting. </p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/cL9Wu2kWwSY?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<p>One thing it really underscores is that staying current is very important, and as &#8220;other stuff&#8221; comes up in life, I&#8217;m making it a personal goal to continue learning&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=28&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/04/09/interesting-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Arrays over DB Link</title>
		<link>http://jholoman.wordpress.com/2009/04/08/arrays-over-db-link/</link>
		<comments>http://jholoman.wordpress.com/2009/04/08/arrays-over-db-link/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 01:39:26 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=15</guid>
		<description><![CDATA[I recently had a problem come up where we needed to return a resultset via database link. I was aware that the data types allowed over DB link were somewhat restricted: no ref-cursors, no object types (including XMLType) to name a few. I wasn&#8217;t aware that you could use PL/SQL Associative arrays (index-by tables) via [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=15&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had a problem come up where we needed to return a resultset via database link. I was aware that the data types allowed over DB link were somewhat restricted: no ref-cursors, no object types (including XMLType) to name a few.</p>
<p>I wasn&#8217;t aware that you could use PL/SQL Associative arrays (index-by tables) via db link. Here&#8217;s a small example:</p>
<p>On the remote db:</p>
<pre class="brush: sql;">
SQL&gt; create or replace package aa_test
    as
    type my_emp_type is table of emp%rowtype index by pls_integer;
    function get_emp(p_empno in number) return my_emp_type;
    end;
    /

Package created.
SQL&gt; create or replace package body aa_test
    as
    function get_emp(p_empno in number) return my_emp_type
    as
    l_emp_rec my_emp_type;
    begin
     select * bulk collect into l_emp_rec from emp where empno = p_empno;
    return l_emp_rec;
    exception when no_data_found then
    null;
   end get_emp;
   end aa_test;
  /

Package body created.
</pre>
<p>And Locally:</p>
<pre class="brush: sql;">
SQL&gt; declare
    l_local_emp_rec aa_test.my_emp_type@holoman;
    begin
    l_local_emp_rec := aa_test.get_emp@holoman(7654);
    dbms_output.put_line(l_local_emp_rec(1).ename);
    dbms_output.put_line(l_local_emp_rec(1).job);
    end;
    /
MARTIN
SALESMAN

PL/SQL procedure successfully completed.
</pre>
<p>Always nice to learn something new.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=15&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/04/08/arrays-over-db-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Show / Hide Report Columns with jQuery</title>
		<link>http://jholoman.wordpress.com/2009/04/07/show-hide_jquery/</link>
		<comments>http://jholoman.wordpress.com/2009/04/07/show-hide_jquery/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 03:17:13 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[APEX]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=4</guid>
		<description><![CDATA[I have been a benefactor of others work regarding the Hide/Show columns functionality that I believe Carl first implemented here: http://apex.oracle.com/pls/otn/f?p=11933:46 Vikas and  Denes also have examples. The one thing that always kind of bothered me about the example was that in order to save the user&#8217;s preference, you needed to click a button. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=4&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been a benefactor of others work regarding the Hide/Show columns functionality that I believe Carl first implemented here: <a href="http://apex.oracle.com/pls/otn/f?p=11933:46">http://apex.oracle.com/pls/otn/f?p=11933:46</a></p>
<p><a href="http://htmldb.oracle.com/pls/otn/f?p=24317:108">Vikas</a> and  <a href="http://apex.oracle.com/pls/otn/f?p=31517:78">Denes</a> also have examples. The one thing that always kind of bothered me about the example was that in order to save the user&#8217;s preference, you needed to click a button. This doesn&#8217;t seem so intuitive to me, so I decided to revamp the example a bit and save the preference based on a cookie.</p>
<p>You can see this in action here:</p>
<p><a href="http://apex.oracle.com/pls/otn/f?p=18507:5">http://apex.oracle.com/pls/otn/f?p=18507:5</a></p>
<p>I rewrote the code with jQuery and strayed a bit from the original implementation, but I think it works ok</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=4&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/04/07/show-hide_jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
		<item>
		<title>Franklin Street</title>
		<link>http://jholoman.wordpress.com/2009/04/07/franklin-street/</link>
		<comments>http://jholoman.wordpress.com/2009/04/07/franklin-street/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 03:11:46 +0000</pubDate>
		<dc:creator>jholoman</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://jholoman.wordpress.com/?p=9</guid>
		<description><![CDATA[Last night my brother and a bunch of other friends made the trip to Chapel Hill to watch the Tarheels crush Michigan St. I couldn&#8217;t make it up there, but it looked crazy: http://vimeo.com/4039511<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=9&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last night my brother and a bunch of other friends made the trip to Chapel Hill to watch the Tarheels crush Michigan St. I couldn&#8217;t make it up there, but it looked crazy:</p>
<p><a href="http://vimeo.com/4039511">http://vimeo.com/4039511</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jholoman.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jholoman.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jholoman.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jholoman.wordpress.com&amp;blog=7277291&amp;post=9&amp;subd=jholoman&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jholoman.wordpress.com/2009/04/07/franklin-street/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/970ebcd76a3134dd2b08c8d0484fa3bb?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">jholoman</media:title>
		</media:content>
	</item>
	</channel>
</rss>
