APEX-AT-WORK no image

Set item value with AJAX

Von Tobias Arnhold 2.17.2010
Update an APEX item dynamically with AJAX:

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

// 2. Page: HTML Header
<script language="JavaScript1.1" type="text/javascript">
function fnc_setValue(v_item)
{
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=v_dummy',0);
get.add(v_item,html_GetElement(v_item).value)
gReturn = get.get();
html_GetElement(v_item).value = v_item;
get = null;
}
</script>

Denes described it more detailed (plus example) in his blog:
Setting Item Session State using Ajax

Have you seen the advanced freeze panes example like you can use in Oracle Forms?
Freeze Panes in an APEX Report: Now with columns

Updated script 22.02.2010:

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

// 2. Page: HTML Header
<script type="text/javascript">
function fnc_setValue(v_item)
{ // Works with select lists, radio buttons, ...
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=v_dummy',0);
get.add(v_item,$v(v_item))
// For Display as Text items add:
// html_GetElement('v_item').innerHTML = $v(v_item);
gReturn = get.get();
get = null;
}
</script>

Post Tags: