Thread: TRICK: Dynamic Item Help Text as Tooltip


Permlink Replies: 32 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Jun 26, 2008 7:30 PM Last Post By: Sujay Dutta
Kathryn S

Posts: 314
Registered: 10/19/04
TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 1:41 PM
Click to report abuse...   Click to reply to this thread Reply
I tried to be a good Apex Community Citizen and put this in the Tips and Tricks Studio, but it hasn't been updated since HTMLDB 2.0 and I couldn't select Apex 3.0, so I'm putting it out here for now.


I'm sure I'm not the first to figure this out, but I thought maybe it would help some newbies. Also, if someone can think of a more efficient way to do this (probably through AJAX), I'm all ears.


1. Enter help text for your items (Page Items)
2. In the Utilities Page, go to Apex Views and query APEX Application Page Items to get the ITEM_ID of each Page Item with help text.
3. On page 0, create hidden items for each of the Page Items with help text. The source of these items will be SQL Query, and the query is:


select ITEM_HELP_TEXT
from APEX_APPLICATION_PAGE_ITEMS
where APPLICATION_ID = <your app id> and PAGE_ID = <your page id> and ITEM_ID = <your Page Item id>

Be sure to set the Source to "Only when Item is null..." to prevent running the same query over and over when the page is rendered.

4. Back on your page, set your pre-element text to "<span title="&P0_ITEM_HELP.">", using the appropriate item name from page 0, and set the post-element text to "</span>."

Now run the page and when your mouse hovers over the item, the Item Help Text will appear as a tooltip.

Jes

Posts: 5,398
Registered: 06/19/04
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 2:37 PM   in response to: Kathryn S in response to: Kathryn S
Click to report abuse...   Click to reply to this thread Reply
Kathryn,

Excellent tip, thanks for sharing.

John.
Kathryn S

Posts: 314
Registered: 10/19/04
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 2:42 PM   in response to: Jes in response to: Jes
Click to report abuse...   Click to reply to this thread Reply
Thanks, and you're welcome!

I did notice though, that in IE the tooltip doesn't show up for select lists.
Dimitri Gielis@AE

Posts: 1,844
Registered: 04/21/07
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 2:44 PM   in response to: Kathryn S in response to: Kathryn S
Click to report abuse...   Click to reply to this thread Reply
Very nice Kathryn!
I'll add this to my weekly APEX forum wrap-up on my blog: http://dgielis.blogspot.com

Dimitri
carl.backstrom@...

Posts: 3,792
Registered: 06/05/02
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 5:12 PM   in response to: Dimitri Gielis@AE in response to: Dimitri Gielis@AE
Click to report abuse...   Click to reply to this thread Reply
Hello,

Also, if someone can think of a more efficient way to do this (probably through AJAX), I'm all ears.

Where I live that's what we call a challenge :)

So
one OnDemand Process ,
one Label Template,
one Javascript function
and a bit of HTML ("Shoot, a feller could have a pretty good time in Vegas with all that stuff!")

and ........ http://apex.oracle.com/pls/otn/f?p=11933:121 there you go.

Though even I admit it's not the first time I've seen this we played around with it a bit for the Application Builder for version 2.0 (thanks to Kris Rice) but with the new views it makes it a bit easier

Enjoy,
Carl
Denes Kubicek

Posts: 4,750
Registered: 06/22/00
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 1, 2007 11:35 PM   in response to: carl.backstrom@... in response to: carl.backstrom@...
Click to report abuse...   Click to reply to this thread Reply
Carl,

This is great. Thank you. Yesterday, trying out the example from Kathryn, I have the same
thoughts - getting this working using AJAX instead. However, you are faster and much
better in that that I am :).

Denes Kubicek
wbfergus

Posts: 1,059
Registered: 05/11/99
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 2, 2007 3:55 AM   in response to: Denes Kubicek in response to: Denes Kubicek
Click to report abuse...   Click to reply to this thread Reply
Kathryn and Carl,

Very nice tip and implementation.

I haven't played around with this yet, only read the thread so far and took a quick look at Carl's example, but since Kathryn's original post uses a SQL query, it also seems like this could be easily modified to select the comment from SYS.DBA_COL_COMMENTS, so people like me that put in verbose comments in the tables (or views) can use those, cutting down on trying to keep all the "text" about a field in sync.

Bill Ferguson
Kathryn S

Posts: 314
Registered: 10/19/04
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: May 2, 2007 6:13 AM   in response to: wbfergus in response to: wbfergus
Click to report abuse...   Click to reply to this thread Reply
Very cool, Carl--I figgered you could make it happen with AJAX. I'm going to experiment with that today.

Bill, if we were better about commenting our columns, we'd probably use the comments for the help text. In fact, I'm going to put that on my to-do list for the week.
MovingTarget

Posts: 110
Registered: 02/26/07
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 19, 2007 12:47 PM   in response to: Kathryn S in response to: Kathryn S
Click to report abuse...   Click to reply to this thread Reply
I am experiencing problems implementing this "Trick" within my application. I have verified that I have copied all of the code correctly into the appropriate locations. I hard-coded my Application ID, Page ID and Item ID into the Application Process which I named AJAX_ITEM_HELP as instructed. When I run my application and mouse-over, I get an error on the page popup indicating a missing object (Code 0). I did make one change to the OnDemand Process (AJAX_ITEM_HELP). I changed APEX_APPLICATION_PAGE_ITEMS to HTMLDB_APPLICATION_PAGE_ITEMS since I am running HTMLDB build 2.0.0.00.49. Does anyone know of any other compatability issues/changes which I should make? Thanks.

Ed
Phil UK

Posts: 533
Registered: 09/14/06
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 19, 2007 12:55 PM   in response to: carl.backstrom@... in response to: carl.backstrom@...
Click to report abuse...   Click to reply to this thread Reply
Carl
Superb - I'm going to use this in a tree view I have developed that due to performance issues only pulls back the basic info. When a user moves over nodes I can pull back the remaining data for each node they select now rather than pulling back the entire dataset for each node.
Phil
carl.backstrom@...

Posts: 3,792
Registered: 06/05/02
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 19, 2007 1:00 PM   in response to: MovingTarget in response to: MovingTarget
Click to report abuse...   Click to reply to this thread Reply
Hello,

since I am running HTMLDB build 2.0.0.00.49. Does anyone know of any other compatability issues/changes which I should make?

This is example is using some of the APEX 3.0 views. It's going to be much tougher to do this in the older versions. I know it can be done but I don't even have pre 3.0 version available to me anymore.

Sorry,
Carl
MovingTarget

Posts: 110
Registered: 02/26/07
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 19, 2007 1:40 PM   in response to: carl.backstrom@... in response to: carl.backstrom@...
Click to report abuse...   Click to reply to this thread Reply
I wouldn't think that it would be that difficult though since most of the items do cross between versions and most of the work is pure HTML and Javascript. I have tried querying my database for the APEX_APPLICATION_PAGE_ITEMS and cannot find it nor HTMLDB_APPLICATION_PAGE_ITEMS.

I suspect this is a new view constructed within version 3.0, but it should be something that can be replicated in a 2.0 database.
MovingTarget

Posts: 110
Registered: 02/26/07
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 20, 2007 7:37 AM   in response to: MovingTarget in response to: MovingTarget
Click to report abuse...   Click to reply to this thread Reply
After further research, I was able to verify that the APEX_APPLICATION_PAGE_ITEMS is a view available for versions 2.2 and later. For those of us who are required to remain on version 2.0 I have been able to find most of the information I need in SYS.WWV_FLOW_STEP_ITEMS and SYS.WWV_FLOW_STEP_ITEM_HELP. I am in the process of creating a view to emulate the APEX_APPLICATION_PAGE_ITEMS.

My question is two part. First, can someone provide a DESCRIBE of the view APEX_APPLICATION_PAGE_ITEMS. Actually, the SQL would be more informative, but I will settle for a describe.

Second, there is a join issue between WWV_FLOW_STEP_ITEMS and WWV_FLOW_STEP_ITEM_HELP. I can join on FLOW_ID (APPLICATION_ID), but I am unable to join on the specific PAGE_ID. Can anyone provide assistance determining what additional joins might be necessary to accomplish this.

Assistance is greatly appreciated. Thanks
Ed
MovingTarget

Posts: 110
Registered: 02/26/07
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 27, 2007 10:51 AM   in response to: carl.backstrom@... in response to: carl.backstrom@...
Click to report abuse...   Click to reply to this thread Reply
Carl (or anyone who can help),

I was successful creating an HTMLDB version 2.0 view emulating the APEX_APPLICATION_PAGE_ITEMS view and I have moved on trying to implement the dynamic item help text tooltip which you mentioned earlier in this thread. I have encountered a few problems though and am seeking assistance. When executing the onmouseover on a page item, the call to dShow() is generating an error that 'p' is undefined followed by 'Object doesn't support this property or method.' I have isolated the problem to the following line of function dShow():

if( p.readyState == 1){

I could not find reference to the initialization of 'p'. Exactly what is 'p' and am I missing something? I am running IE 6.0 and as I mentioned earlier, version 2.0 of HTMLDB. I have inserted the beforement code as instructed by you and Kathrine.

Any assistance is appreciated. Thanks.
carl.backstrom@...

Posts: 3,792
Registered: 06/05/02
Re: TRICK: Dynamic Item Help Text as Tooltip
Posted: Jun 27, 2007 1:39 PM   in response to: MovingTarget in response to: MovingTarget
Click to report abuse...   Click to reply to this thread Reply
Hello,

Yeah your missing something that is in 3.0 (used to be in my htmldb_remix.js but has been removed because well now it's in 3.0). Anyway add this into your page header or static js file.

/* 
this adds better aysnc functionality
to the htmldb_Get object
pVar is the function that you want to call when the xmlhttp state changes
in the function specified by pVar the xmlhttp object can be referenced by the variable p
*/
htmldb_Get.prototype.GetAsync = function(pVar){
try{
p = new XMLHttpRequest();
}catch(e){
p = new ActiveXObject("Msxml2.XMLHTTP");
}
try {
var startTime = new Date();
p.open("POST", this.base, true);
if(p) {
p.onreadystatechange = pVar;
p.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
p.send(this.queryString == null ? this.params : this.queryString );
return p;
}
}catch(e){
return false;
}
}

Carl
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums