Browsing "Older Posts"

APEX-AT-WORK no image

Button with changing icon

Von Tobias Arnhold → 5.24.2010
A while ago I wrote how to create your own Javascript buttons inside a region:
http://apex-at-work.blogspot.com/2009/05/building-your-own-button-in-apex-region.html

Here the example about how to change the icon "on mouse over" event:
Changing Images on Mouseover Using JavaScript


<img
id="#CURRENT_ITEM_ID#_btn"
src="/i/unpressed-icon.gif"
alt="Search"
onclick="javascript:doSubmit('SEARCH')"
style="cursor: pointer"
title="Search"
onmouseover="document.#CURRENT_ITEM_ID#_btn.src='/i/pressed-icon.gif'"
onmouseout="document.#CURRENT_ITEM_ID#_btn.src='/i/unpressed-icon.gif'"
>

Update 01.06.2010:
In case you want to use it inside your report then use this code snippet:

SELECT...
'<img src="/i/bilder/icon-unpressed.gif"'
|| ' id="btn_ID' || rownum || '" style="cursor: pointer"'
|| ' title="Save changes!" alt="Save changes!"'
|| ' onmouseover="document.btn_ID' || rownum || '.src=''/i/bilder/icon-is-pressed.gif''"'
|| ' onmouseout="document.btn_ID' || rownum || '.src=''/i/bilder/icon-unpressed.gif''" />' as BTN_PRESS
FROM ...
APEX-AT-WORK no image

AAW-DBMON geht in erster Beta Version unter APEX 4 EA3 ONLINE

Von Tobias Arnhold → 5.15.2010
The following post is targeted towards a German audience, thus it is in German:

Wie vor einer ganzen Weile versprochen habe ich es endlich geschafft ein erstes Beta Release der AAW-DBMON Anwendung Online zu bringen! Das Release läuft schon unter APEX 4.0! Also schaut es euch mal an. Es können aus administrativen Gründen keine Daten dynamisch generiert werden. Also gebt GROßE Zeiträume bei den Charts an.
AAW-DBMON - http://tryapexnow.com/apex/f?p=2508:1:
Account:
Admin, Password: admin
Monitoring, Passwort: monitoring

Die Beta-Tester erhalten in den nächsten Tagen das aktuelle Release + Anleitung.

Call Javascript function from APEX report column link

Von Tobias Arnhold → 5.14.2010
I know it is not really new but it is always good to have an example just for the case you don't have all code in your head! :D

Column-Link:
Link Text: <img src="/i/my_icons/small_icon.png" alt="Short preview">
Link Attribute: title="Short preview"
Target: URL
URL: javascript:fnc_preview('111',#ID#);



Tip: GIF's with empty background can be displayed by IE6. PNG files can be displayed by IE6.
APEX-AT-WORK no image

onClick event over whole EXTJS tree node

Von Tobias Arnhold →
I while ago I had an issue with the ExtJS tree. Somebody mentioned that not all parts of an ext tree node (for example the icons or the empty area) get called by an onClick event. There are just two line of code you need to add to your tree:

tree.on('click', function(node){ // tree is the created ExtJS tree object
fnc_openWindow(node.id); //this is the javascript function I call
});


Watch the whole post in the ExtJS forum to get more information about it:
http://www.extjs.com/forum/showthread.php?95597-Ext-tree-href-event-on-whole-div-element
APEX-AT-WORK no image

Highlight last inserted rows inside a standard report

Von Tobias Arnhold → 5.13.2010
To show last updated rows inside a report isn't as hard as it sounds.
All you need is a time column which saves the insert date and some changes on your report template!

Go into your report template and change it like this:

Column Template 1:
<td class="new_css_class_with_different_color" #ALIGNMENT# id="#COLUMN_HEADER#_#COLNUM#_#ROWNUM#">#COLUMN_VALUE#</td>
PL/SQL Condition:
to_date('#DATE_COLUMN#','DD.MM.YYYY HH24:MI:SS') > (SYSDATE - INTERVAL '10' MINUTE)

Column Template 2:
<td class="old_css_class" #ALIGNMENT# id="#COLUMN_HEADER#_#COLNUM#_#ROWNUM#">#COLUMN_VALUE#</td>

In this example all rows which are younger than 10 minutes will be shown with a different background color. Which is defined inside the CSS class.
APEX-AT-WORK no image

Get radio button value with javascript

Von Tobias Arnhold →
Most of you know how to get an HTML session value inside APEX:
  $x('P1_NAME').value
To get the current value from a radio button use this APEX function:
  $f_ReturnChecked('P1_DEPARTMENT')

// 1. Item: HTML Form Element Attributes:
onChange="javascript:fnc_setRadioItem('P1_DEPARTMENT')";

// 2. Page: HTML Header
<script type="text/javascript">
function fnc_setRadioItem(v_radioItem)
{
// Create AJAX request object with JavaScript class "htmldb_Get"
// 1. Parameter: Appointed for 'Partial Page Refresh', not needed
// 2. Parameter: Determined the actual application ID
// 3. Parameter: Defines the application process, I use a dummy value
// 4. Parameter: For 'Partial Page Refresh': not needed
var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=v_dummy',0);
get.add(v_radioItem,$f_ReturnChecked(v_radioItem))
gReturn = get.get();
//html_GetElement(v_radioItem).value = v_radioItem;
get = null;
}
</script>

You can find even more functions inside the APEX documentation: API Reference - 9 JavaScript APIs

Tip für die deutsche Community: APEX AJAX und JQuery HowTo Beispiel