AJAX  Callbacks  & apex.ajax.ondemand     -  APEX 4.0

Hello,
I am trying to use the apex.ajax.ondemand(pWidget,pReturn) package for the Ajax Callbacks functionality in APEX 4.0. However since I need the $v('pFlowStepId') to identify the ondemand process within the application and the apex.ajax.ondemand() package does not allow for the inclusion of this parameter I am unable to use it.
Do you have any suggestions besides using the the htmldb_Get directly to work with the Ajax Callbacks functionality in 4.0?
Thanks ahead for any information you can provide.
Rafael J

KP wrote:
Hi,
I am dynamically creating a HREF link in my Apex report using SQL. this links invokes an Ajax Process on the same page.
The process is an on Demand Ajax Call back that calls a Stored Proc.
All seems to work as expected, with one small issue, A blank page is displayed once the process is called, the process page does not return back to the page it was called from. Can someone let me know where i am going wrong.
This is the Query i use to create a dynamic HREF via my Report SQL ...Notice the <a href...> syntax. The name of the process flow is CALL_PROCESS_FLOW
select "RUN_ID",
"JOB_NAME",
"JOB_START_DATE",
"JOB_END_DATE",
'Ajax' SP1
from "#OWNER#"."VW_JOB_CONTROL"
where job_name='CLN_INPATIENT_FCE'
I have tried getting rid of the colons after the name of the process flow. I have also tried the same with and without the # at the end. However it still returns the same error.
Can some one help. I know its something small but i just can seem to figure it out.I don't think you are making an ajax call here and you are just invoking the APEX application process via URL
Use the below javascript function to make a call ajax
function myAjaxProcess() {
var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CALL_PROCESS_FLOW',$v('pFlowStepId'));
//invoke it now
gReturn = get.get();
// you can alert the ajax call back
//alert(gReturn);
}Replace your href value (href="f?p=&APP_ID.:2:&SESSION.:APPLICATION_PROCESS=CALL_PROCESS_FLOW:::::#")
like this
href="javascript:myAjaxProcess();"

Similar Messages

  • Apex.ajax.ondemand  error (c00ce56e) in IE ( it can run in firefox )

    I try a ajax request by      apex.ajax.ondemand.
    And follow the url: http://www.oracle.com/technology/obe/hol08/apexweb20/ajax_otn.htm#s
    This code can run firefox, but it's error in IE!
    ===============
    var lRequest = new apex.ajax.ondemand('Get_Exch_Rate', function() {
              var l_s = p.readyState;
              if (l_s == 1 || l_s == 2 || l_s == 3) {
              } else if (l_s == 4) {
                   // alert("readyState 4:"+ p.responseText);
                   html_GetElement(exch_rate_id).value = p.responseText;      
                   detailCount();
              } else {
                   alert("readyState other");
                   return false;
         var value = $x(pThis).value;
         // alert(value);
         lRequest.ajax.addParam('x01', value);
         lRequest._get();
    =============
    "Could not complete the operation due to error c00ce56e" in this line
    html_GetElement(exch_rate_id).value = p.responseText;
    It still error when change it to alert("readyState 4:"+ p.responseText);
    Please help

    I change the chartset to UTF-8 , then it can work in IE too.

  • How do I customize the error page

    Our IT department has adopted a policy that requires a standard look and feel for all error pages encountered in any web application. To this end I need to be able to modify the error page that shows up on the browser when an unexpected error is encountered or a validation error is sent to a new page.
    How can I modify this page? Is there a template for it, and if so where?
    Any help is greatly appreciated,
    Adam Cumming

    Hello Bhavin,
    I have already started looking at this links (you copied twice Marc Lancaster's page, instead of Roel Hartmans's, which is actually : http://roelhartman.blogspot.com/2009/09/transform-ora-xxxx-messages-into.html)
    I'm focused on Marc Lancaster's solution (Friendly Exception Messages), which is also interesting because it covers Ajax manipulation inside Apex (i'm using Apex 2.1).
    But it seems that the apex.ajax.ondemand(...) line doesn't do anything to my application. Here is the code of this line :
    var lRequest = new apex.ajax.ondemand('test', function(){     
                                                          var l_s = p.readyState;
                                                        if(l_s == 1||l_s == 2||l_s == 3){
                                            }  else if(l_s == 4){
                                            gReturn = p.responseText;
                                            $s('ajax-drop',gReturn); }
                                            else{return false;}
                                              );Because that's the first time I'm trying Ajax, I don't see what could be silly (I just copied the code from Marc's example).
    Here is the application process, called 'test' :
    begin
      htp.p('Hello !');
    end;Thanks a lot.
    Dovik

  • Trouble setting the session state of a select item.

    Hi,
    I have a requirement whereby I need to change the session state of a select list item in my form without the need to submit. I am using Application Express 4.1.0.00.32. I thought this would be straight forward using a dynamic action or javascript and calling an on demand process for example.
    P1_MY_SELECT onchange="set_option();"
    function set_option() {
    var l_option=$f_SelectValue('P1_MY_SELECT');
    alert( 'My new value is ' + l_option );
    // ON DEMAND Set the new session state value
    var lRequest = new apex.ajax.ondemand
    ('SET_P1_MY_SELECT',function()
    {  /* start the return function */
    var l_s = p.readyState;
    if(l_s == 1||l_s == 2||l_s == 3)
    else if(l_s == 4)
    { gReturn = p.responseText;
         (gReturn)?json_SetItems(gReturn):null;
    else{return false;}
    /* end the return function */
    lRequest.ajax.addParam('x01', l_option );
    lRequest._get()
    My on demand application process
    DECLARE
    l_options varchar2(2000) := wwv_flow.g_x01;
    BEGIN
    APEX_UTIL.SET_SESSION_STATE('P1_MY_SELECT',l_options);
    apex_util.json_from_items('P1_MY_SELECT');
    END;
    Is there a better method to set the session state of my P1_MY_SELECT other than what I am doing as above or can you tell me why the session state of P1_MY_SELECT is not changed?
    Thanks.
    Edited by: 968358 on 01-Nov-2012 08:40

    if you are on 4.1 why don't you use a dynamic action instead of writing the code again?
    create a dynamic action like this
    Event: Change
    Source Type: Item
    Item: P1_MY_SELECT
    True Action:
    =========
    Action: Execute Plsql Code
    Plsql Code: null;
    Page Items to Submit: P1_MY_SELECT
    Page Items to Return: P1_MY_SELECT (this is optional)
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/advnc_dynamic_actions.htm#HTMDB27020

  • APEX 4.0 - AJAX not working with Popup LOV field

    Hello,
    In the application I have built I have three fields which are 'feeded' by selects via a AJAX construction.
    All three fields are based on three others, which are PopUp LOV fields. Up to version 3.2 I had no problems: the fields were 'refreshed' as expected when in the 'parent' field a specific value was entered or choosen by the Popup Lov selector.
    But since the migration to APEX-4 (lin a test-system) all the three fields are not correctly refreshed anymore: two of them give the value 'undefined', the third, which is a select-list shows values, but at the moment I try to click on the select-list down arrow to pick a value, the list is emptied and stays that way.
    More specific about the third field:
    item 1 is a popup-lov defined item in which a user can type a value, but can also choose a value from a popup-lov. Item 2 is based on item-1: it does a select based on the value of item-1 and refreshes a select-list. Item-2 is defined as a select list.
    I got it all working when making item-1 also a select list, but since the list can become very large, I made a Popup lov of it. Most users do know what code they have to enter and in case somebody is not sure, the lov can be used.
    In this forum I came across a problem with AJAX callback, which was answered by Patrick Wolf, saying that in an htmldb_Get ( ... ,0) the last 0 should be replaced by $v('pFlowStepId'), but this did not fix my problem. I have the feeling that the problem is somewhre else, since on first hand, after entering a value in item-1 I see item-2 refreshed with the correct values, but the moment I try to select one item, the list is emptied.....
    I hope I made it clear what my problem is and that somebody can help me, else APEX-3.2 was the latest version for this application....
    Thanks in advance and best regards,
    Jan.
    Edited by: user13110728 on 9-aug-2010 8:44

    Hi Jan,
    the problem is the
    onBlur="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"on P21_GBREKNR. This is getting attached to the HTML input text field but as well the the anchor link which opens the popup. So when you leave the text field the cursor will be put onto the icon to open the Popup LOV. When you press tab another time or leave the anchor link by clicking somewhere the above JavaScript function is fired again. But the problem is that "this" this time points to the anchor and not the text item anymore, so it will return an invalid value when you access this.value in your f_P21_select_kostenposten function which results in an empty result of your on-demand call.
    I still have to investigate why the above JavaScript code is now added to the anchor link as well. But as a workaround, just change your code to
    onChange="javascript:f_P21_select_kostenposten(this,'P21_KOSTENPOST');"which is better anyway, because it's just firing when the value really got changed. And because the anchor link can't really be changed, the event will never fire when you leave the anchor. BTW you can use the Application Search feature to search for all your onBlur events. onChange is much better than onBlur because it doesn't fire that often unintended.
    But if you want to use some of the new APEX 4.0 features, you could use the cascading LOV feature of APEX 4 and avoid all this JavaScript and on-demand code which you have written.
    I have changed your application to take use of it.
    1) I changed the LOV query for P21_KOSTENPOST from
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
    order by gbreknr, kostenpostto
    select '('||replace(lpad(gbreknr, 3, chr(1)),chr(1),' ')||') '|| omschrijving d, kostenpost r
    from   kostenposten
    where  vervallen is null
      and  bedrijf = :P21_BEDRIJF
      and  (:P21_GBREKNR is null or gbreknr = :P21_GBREKNR)
    order by gbreknr, kostenpostas it was in your on-demand process. The query will return all values if P21_GBREKNR is null but will restrict it if the field is filled out.
    2) Set "Cascading LOV Parent Item(s)" to P21_BEDRIJF,P21_GBREKNR Because based on your LOV query I assume "Kostenpost" should be refreshed if one of the two fields gets changed.
    3) Set "Optimize Refresh" to No because one of your parent items (P21_GBREKNR) can contain a null value.
    4) Removed the onBlur/onChange from P21_GBREKNR
    5) Removed the *%null%* from the "Null Return Value" attribute of P21_BEDRIJF, because that will cause a ORA-1722 if someone picks "-- kies: --"
    That's it.
    Have a look at dynamic actions and the "Set Value" action as well, because I think that could remove your other on-demand calls as well without having to write any JavaScript code.
    I will still investigate what's going on with the anchor link in APEX 4.0
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Using AJAX with ApEx

    Hi All,
    I'm new to Ajax and I'm trying to create an alert that prompts the user if the information that they entered into a form results in a primary key violation. The problem is that the application procedure that I created is not returning a value when it should be, because I am not receiving the alert when I violate a primary key...I don't know what I am doing wrong. Any help would be much appreciated.
    My javascript code is as follows:
    function checkNull(){
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=P3PK',0);
    get.add('P3_MEMIMPNUM',$x('P3_MEMIMPNUM').value);
    get.add('P3_ACTIONDATE',$x('P3_ACTIONDATE').value);
    get.add('P3_ACTION',$x('P3_ACTION').value);
    ajaxresult = get.get();
    if (ajaxresult)
    alert("Primary Key Violation!");
    get = null;
    The application process P3PK is processed On Demand and the PL/SQL Block is as follows:
    DECLARE
    str_memimpnum varchar2(15);
    BEGIN
    SELECT memimpnum
    INTO str_memimpnum
    FROM tblaction
    WHERE memimpnum = :P3_MEMIMPNUM AND
    actiondate = :P3_ACTIONDATE AND
    action = :P3_ACTION;
    HTP.prn(str_memimpnum);
    END;
    Finally, the save button is set to redirect to a URL and the URL target is as follows:
    javascript:onclick=checkNull();
    Note: There is more to the checkNull function, but I only included the section that I felt was applicable to this issue.
    Thanks in advance!

    Hello,
    Most likley it's an issue with your OnDemand Process.
    Change your alert to
    alert(ajaxresult);
    And then in your process change it to with a htp.prn('Hello World'); to make sure your calling the right thing.
    Then output the item values.
    htp.prn(:P3_MEMIMPNUM);
    Just work your way through it.
    Also you can easily debug these returns using Firebug addon in Firefox. http://www.getfirebug.com
    then
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Values having html tags not getting populated while using AJAX in APEX

    Hi,
    I am using AJAX to populate certain values in a tabular report.
    I have a java script of this form (I have taken this example from Denes's example http://apex.oracle.com/pls/otn/f?p=31517:241:1400877312570049)
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular(pValue, pRow){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    get.add('T_ROWNUM',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    </script>
    And I have the application process as follows
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="f05_000' || :T_ROWNUM || '">' || :TEMPORARY_APPLICATION_ITEM || '</item>');
    HTP.prn ('</body>');
    END;
    If I have :TEMPORARY_APPLICATION_ITEM as 'Vikas' it gets displayed properly but if I have '&lt;b&gt;Vikas&lt;b&gt;' it shows null. if it has any HTML tags function l_Opt_Xml.firstChild.nodeValue is not working properly .Please tell me what modiifcation can I use in function l_Opt_Xml.firstChild.nodeValue to get Values with HTML tags also to get displayed.
    Thanks,
    Vikas

    Vikas,
    Try escaping special characters: htf.escape_sc(:TEMPORARY_APPLICATION_ITEM)Regards,
    Dan

  • Apex.ajax.clob - retrieving data from a clob field

    I have an application that uses a table that stores xml data, and the field in the table that stores the data is a clob. I used Carl Backstrom's example to build what I have so far, (God's blessings on his family). Here is the script I use to store the data from an HTML Editor into the database:
    function clob_set(request){
    var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    $x_Show('AjaxLoading');
    }else if(rs == 4){
    $x_Hide('AjaxLoading');
    $s('P59_CONT', p.responseText);
    doSubmit(request)
    }else{return false;}
    $x('P59_CONT').value = oEditor.GetHTML();
    oEditor.SetHTML('');
    if(!$v_IsEmpty('P59_CONT')){clob_ob._set($v('P59_CONT'))};
    The submit calls a process that inserts the data from the clob001 field in the CLOB_CONTENT collection into my table.
    How do I get the data out of the table again to present in the HTML Editor? Each option I use gets me into trouble with the 32k length limitation that is extant in Apex. What would be the best way to address this?

    Inserting or retrieving a clob in the database is simple and can be done with a pl/sql process. It gets more more complex when the clob is large; I believe the limit is 32k? Larger than that and the HTTP process cannot manipulate the data stream.
    The key to manipulating clobs successfully is through the use of collections, and javascript. In my case, I used the standard html editor item (fckeditor) to retrieve the data and present it on the page through the apex.ajax.clob javascript function. The clob_set method in the apex.ajax.clob function that I mention in the previous sections of this post calls the 'doSubmit(request)' that causes a pl/sql function to be fired that writes the clob to the database from the collection created by the clob_get method. The collection that the clob_get method creates is called 'CLOB_CONTENT', and can be accessed through the 'apex_collections' view through standard sql within APEX. In my case, the pull the 'clob001' field from the 'CLOB_CONTENT' collection after the clob_set method runs, and I insert the value from 'clob001' into the table I have created for storing the clob content. The clob_set pulls the data from the HTML editor (FCKeditorAPI.GetInstance('P59_CONTENT')) through the GetHTML() method that is part of the FCKeditorAPI.
    function clob_set(request){
    var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    $x_Show('AjaxLoading');
    }else if(rs == 4){
    doSubmit(request);
    $x_Hide('AjaxLoading');
    }else{return false;}
    var p_html = oEditor.GetHTML();
    if (p_html){
    clob_ob._set(p_html);
    else {
    p_html = ' '
    clob_ob._set(p_html);
    The clob_get method pulls the data from the 'CLOB_CONTENT' collection and puts it into the html editor item I have created, performing the process in reverse. The primary difference with reversing the process is that a pl/sql function is created that populates the clob001 field in the 'CLOB_CONTENT' collection prior to the clob_get function firing:
    declare
    l_clob clob:= empty_clob();
    begin
    if apex_collection.collection_exists(p_collection_name=>'CLOB_CONTENT') then
    apex_collection.delete_collection(p_collection_name=>'CLOB_CONTENT');
    end if;
    apex_collection.create_or_truncate_collection(p_collection_name=>'CLOB_CONTENT');
    dbms_lob.createtemporary( l_clob, false, dbms_lob.SESSION );
    if trim(:P123_ID) <> 0 then
    select
    nvl (ltr,'There is no letter assigned.')
    into
    l_clob
    from grant_tbl
    where id = to_number(:P123_ID);
    apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
    ,p_clob001 => l_clob
    ELSE
    apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
    ,p_clob001 => 'You must select an item to view its letter.');
    end if;
    end;
    The clob_get function is below. Notice that the line "$s('P123_CONTENT',p.responseText);" is taking the output from the clob_get and setting the value of the P123_CONTENT page item (which is my standard html editor item) with the 'responseText'. the 'p' object and the 'responseText' method are built into the clob_get function when a 'new apex.ajax.clob' object is created. Confusing? Tell me about it!
    function clob_get(){
    var clob_ob = new apex.ajax.clob(
    function(){
    var rs = p.readyState
    if(rs == 1||rs == 2||rs == 3){
    null;
    }else if(rs == 4){
    $s('P123_CONTENT',p.responseText);
    null;
    }else{return false;}
    clob_ob._get();
    }

  • Oracle apex upload images ajax CLOB_CONTENT not filled

    I'm working with 4.2.5.00.08 on Oracle 12.1.0.2- 64 on Windows.
    What am I doing wrong with this code.
    I created a HTML5- dropbox to upload an image
    This "always" worked, but now I don't seem to get it working again.
    To be exact: the C001 column of the CLOB_CONTENT stays empty.
    I have the feeling I'm overlooking something, but I can't put my finger on it.
    Someone who sees the problem?
    ON DEMAND PROCES : dummy
    begin
      insert into m2b_images
        ( id, blob_content
      select 1
      ,      apex_web_service.clobbase642blob
                    ( dbms_lob.substr( col.clob001
                                    ,  dbms_lob.getlength(col.clob001)
                                    , dbms_lob.instr(col.clob001,',',1,1) + 1
      from   apex_collections col
      where  col.collection_name = 'CLOB_CONTENT'
      and    col.c001 is not null;
    exception
      when others
      then
        rollback;
        htp.p(sqlerrm);
    end;
    Javascript on the page (on the page there's a div dropbox and a div droplabel)
    <script>
    (function dropboxFunctionality() {
      var dropbox;
      function dragExit(evt) {
        evt.stopPropagation();
        evt.preventDefault();
      function dragEnter(evt) {
        evt.stopPropagation();
        evt.preventDefault();
      function dragOver(evt) {
        evt.stopPropagation();
        evt.preventDefault();
      function handleReaderLoadEnd(evt) {
        var clobObj = new apex.ajax.clob(function (p) {
          if (p.readyState == 4) {
            $("#droplabel").html("Uploading...");
            var get = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=dummy', $v('pFlowStepId'));
            gReturn = get.get();
            if (gReturn === "") {
              $("#droplabel").html("Ready...");
            } else {
              alert(gReturn);
        clobObj._set(evt.target.result);
      function handleFiles(files) {
        var file, reader;
        file = files[0];
        $("#droplabel").html("Processing " + file.name + "...");
        reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onloadend = handleReaderLoadEnd;
      function drop(evt) {
        var files, count;
        evt.stopPropagation();
        evt.preventDefault();
        files = evt.dataTransfer.files;
        count = files.length;
        if (count > 0) {
          handleFiles(files);
      if (window.File && window.FileList && window.FileReader) {
        dropbox = document.getElementById("dropbox");
        $("#P2_FILE_NAME").hide();
        $('#P2_UPLOAD').hide();
        dropbox.addEventListener("dragenter", dragEnter, false);
        dropbox.addEventListener("dragexit", dragExit, false);
        dropbox.addEventListener("dragover", dragOver, false);
        dropbox.addEventListener("drop", drop, false);
      } else {
        $("#dropbox").hide(); //No drag and drop supported. Hide the container
    </script>

    really? Nobody saw that i checked for the wrong column c001 instead off clob001.
    ah well

  • Apex 4.0 Cascading Select List: ajax problem with german umlaute

    Hi everybody,
    Apex 4.0
    Dad PlsqlNLSLanguage: GERMAN_GERMANY.WE8MSWIN1252
    I have problems with german umlaute and ajax cascading select lists (Cascading LOV Parent Item).
    The data is populated without a page refresh in the select list when the parent select list changes but special signs like german umlaute are shown as weird characters.
    Seems like there is some charset problem with ajax.
    This is the only part of the application where special signs like umlaute are messed up. Everything else is fine.
    I allready tried to figure out if I can escape the umlaute in the javascript (file apex_widget_4_0.js) but no success here.
    Can anybody help me with this issue?
    Thanks in advance,
    Markus

    Hi Markus,
    your specified character set in your DAD is wrong. As mentioned in the installation instructions at http://download.oracle.com/docs/cd/E17556_01/doc/install.40/e15513/otn_install.htm#CHDHCBGI , Oracle APEX always requires AL32UTF8.
    >
    3. Locate the line containing PlsqlNLSLanguage.
    The PlsqlNLSLanguage setting determines the language setting of the DAD. The character set portion of the PlsqlNLSLanguage value must be set to AL32UTF8,
    regardless of whether or not the database character set is AL32UTF8. For example:Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Master/Detail/Lookup functionality - ApEx and AJAX vs Oracle Forms

    I'd like to build a master detail form with some lookup functionality and have some of the fields automatically populated. I come from an Oracle Forms and PL/SQL background so I was hoping for some guidance in ApEx and Javascript for how to achieve the same effect.
    If you look at the default Sample Application (DEMO_APP), page 29 has the master record and the corresponding details on the same page.
    The functionality I'd like is:
    1) when a new product is chosen from the Product Name select list, I'd like the Unit Price to be populated.
    2) when the Quantity is updated, I'd like
    a) the Extended Price to be recalculated and
    b) the Order Total to be recalculated
    all before submitting the page. This is pretty trivial in Oracle Forms but I've had limited success with ApEx.
    I've been able to achieve 1) in a single record form but not a tabular form using the techniques from Scott's AJAX generator http://htmldb.oracle.com/pls/otn/f?p=33867:2.
    I've been able to achieve 2a) in a tabular form using the techniques from Vikas in this thread Tabular form with Ajax
    I haven't had any luck getting 2b) to work.
    So, is my wish list possible?
    If it is, I'd appreciate some pointers and/or code. I don't speak Javascript but I can copy and paste ;)
    Cheers,
    Bryan.

    Hi Carl,
    Ok, thanks for the tip - take a look at http://htmldb.oracle.com/pls/otn/f?p=24745 login as demo/demo and edit one of the top orders. This will take you to page 29.
    I've changed the 2.0 Sample Application to allow both the unit_price and the quantity to be overtyped. Each column has the 'Element Attributes' property set to onChange="calcTotal(this)" to call the javascript code.
    This recalculates the extended_price (feature 2a above) but the order total (or the report total) is not affected (feature 2b) - how can I change the code to achieve this?
    If I change an existing line item and choose another product from the select list, I'd like the unit_price and the extended_price to change appropriately (feature 1 above) - having to wait until after the form is submitted is not acceptable to my users.
    Thanks for taking the time to look at this - I really appreciate it.
    Cheers,
    Bryan.

  • Using jQuery Ajax Call within ApEx - How?

    Hi,
    I was just wondering if it's possible to replace Oracle ApEx way of performing ajax calls with a jQuery Ajax call instead - just curious if I can call an On Demand process using jQuery Ajax means?
    Any examples would be much appreciated as unsure how to perform the equivalent process with jQuery.
    Thanks.
    Tony.

    I guess I found the solution for region pull for IR report
    using the syntax
    gReport = new apex.worksheet.ws('');
    in the js script below.
    When I pull the IR region from page8 into page1, I found that the IR toolbar's html/Js scripts are missing in Page1
    and thats why the IR toolbar functions were not working, issuing "gReport is null or not an object" error.
    But when I added the
    gReport = new apex.worksheet.ws('');
    syntax in the JS script below, the toolbar functions work using the p_arg_value.
    <script>
    function display_report(p1) {
    $s('P1_SELECTED_NODE',p1);
    $.ajax({
    type: "POST",
    url: "wwv_flow.show",
    data: {
    p_flow_id : $v('pFlowId'),
    p_instance : $v('pInstance'),
    p_flow_step_id : "4",
    p_request : "SUBMIT",
    p_arg_name : 'P4_SELECTED_NODE',
    p_arg_value : $v('P1_SELECTED_NODE')
    dataType: "html",
    success: function(data){
    var startTag = '<apex4ajax>';
    var endTag = '</apex4ajax>';
    var start = data.indexOf(startTag);
    if (start > 0) {
    data = data.substring(start+startTag.length);
    var end = data.indexOf(endTag);
    data = data.substring(0,end);
    $("#EMP_REPORT").html(data);
    //Workaround to make the report "pagination" and "order by" work
    $x_Value('pFlowStepId', "4");
    gReport = new apex.worksheet.ws('');
    //gValid = new apex.validation.v();
    //gReport.navigate.paginate('pgR_min_row=51max_rows=50rows_fetched=50');
    //gReport.controls.reset();
    </script>

  • Integrate AJAX  with Apex 3.2

    Hi
    I am new to APEX we are doing enhancements to User Interface using Apex 3.2.
    I want to add generic AJAX tool tip code for similar components in all the pages in apex.
    where do i write the code and how to integrate with with apex pages.
    your help in resolving this issue is highly appreciated.
    Edited by: 817204 on Dec 1, 2010 4:09 AM

    Hi,
    I think this blog post is quite simple for start learn Ajax in Apex
    http://www.oracleapplicationexpress.com/tutorials/68
    Regards,
    Jari

  • AJAX inside apex 3

    I've heard a few month ago that this new version is going to be a major change and one of them are some built in features with AJAX, something about better controlling of regions, buttons and other items, is this true ?
    Best regards,
    Victor

    Hello Victor,
    I'm not so sure what you mean by "better controlling" but APEX 3.0 introducing the concept of "drag&drop" in the layout of a page, and it also using AJAX to do that. If you have access to the evaluation instance (and if not, you can apply for one) you can try it yourself.
    Regards,
    Arie.

  • AJAX and APEX not working together

    Hi,
    I've got a page on which I created a normal checkbox list with some 10 rows.
    On the same page I'm using a hierarchical drop down with ajax functionality to populate the child drop down depending on the father drop down value.
    If I have AJAX update the child drop down because of a onChange-event of the father drop down, APEX won't save the value from the checkbox in the session state anymore, preventing a page process to insert the selection into database tables.
    I've seen similar behaviour in some of Denes Kubicek's demo pages where after selecting some AJAX functionality, links won't work anymore etc. So I guess that this is a broader problem. Did anybody else encounter these problems as well? Is there a nice workaround for this?
    Best regards,
    Jürgen

    j.sieben wrote:
    Hi,
    I've got a page on which I created a normal checkbox list with some 10 rows.
    On the same page I'm using a hierarchical drop down with ajax functionality to populate the child drop down depending on the father drop down value.
    If I have AJAX update the child drop down because of a onChange-event of the father drop down, APEX won't save the value from the checkbox in the session state anymore, preventing a page process to insert the selection into database tables.
    I've seen similar behaviour in some of Denes Kubicek's demo pages where after selecting some AJAX functionality, links won't work anymore etc. So I guess that this is a broader problem. Did anybody else encounter these problems as well? Is there a nice workaround for this?
    Best regards,
    JürgenI have multiple pages where AJAX is populating child select lists based on the onchange of a parent select list, and have never had a problem with any other item on the form because of it.
    Does any other item push into session properly, besides the check boxes? Could you provide the URL to the demo page your talking about?

Maybe you are looking for

  • MM -PO RELEASE WORK FLOW

    It is executing once and is getting deactivated. for TS200000166 &WS20000075it is giving the error "IMPORT CONTAINER CONTAINS ERRORS(ARE ANY OBLIGATORY ELEMENTS MISSING). I have used the standard settings only. For TS20000166 I HAVE SLECTED METHOD:SI

  • G470:: screen goes black for sometime (10-15 seconds)

    I have a lenovo g470 laptop bought it a couple of months ago it came with preinstalled windows 7 64 bit. It worked perfectly for a month but nowadays it seems like there is some trouble while booting my windows. when start my windows windows 7 logo a

  • SAP Query for the report

    Hi, Can you all help me? Is there any area or a table or query in SAP, which can create a list with the purchase order number (Field name EBELN),supplier(Field name SUPERFIELD) and header text(Field name EDITOR). Please tell the table name that fetch

  • Runnin oracle apex on a different server to the main production database

    Hi, I'm new to apex. I have a large prod db 20TB+. We want to have some sort of a simple frontend to our data warehouse. We would like to use apex. However we do not want to install APEX schema's etc in our production database. What we want to do is

  • Will SQL Developer support data type anydata

    Will SQL Developer support datatype sys.anydata in future releases? Currently SQL Developer will not show any data for columns of type anydata. Example: create table t1 (id number, col1 sys.anydata); insert into t1 values(1,sys.anydata.convertvarchar