Success through Javascript function message


Hello


I have an Ajax call to call a process like this


var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is ProcessName', 10);

ajaxResult = ajaxRequest.get ();

If (ajaxResult is 'Success')

{

Redirect ('f? p = & APP_ID.:88: & SESSION. :: NO :: ") ;

}

else {}

Alert (ajaxResult);

}


So when ajaxResult is 'Success', I need to redirect to another page and show some success Notification there, something like "Action Processed" in the Notification of success Message box

.


Can anyone help me out in this please.


Thanks,

Sai.


Hi Sai,

I have "faced with the fact that what you describe is exactly what APEX natively without worries if you place the AJAX code in a process, and then creates a branch to a new page on our success.

Why do you need in this case the process of AJAX?

That said, once you start to replicate the native behavior on your own, you will continue to add more code.  Here are a few ideas:

* If you can't to p88 after success then add a region to your page that has the same HTML code like the message of the success of your page template.  For example, theme 25, my HTML content should look like this:

#CLOSE_NOTIFICATION #.

Processed action

Of course you could make conditional.  For example, only show with a request-specific value.  Fear what SUCCESS.  Then your redirect after the AJEX call would look like this:

Redirect("f?p=&APP_ID.:88:&session.:Success:no::");

Then the region appears only when the request arriving is success.

* You may also inject the message of success HTML via javascript.  But again, who becomes messy.

Thank you

-Jorge

Tags: Database

Similar Questions

  • Pass the value to the process of request through javascript

    Hey everybody,

    I am currently struggling with the call to an application process and passing a value to it through javascript. Ideally, my javascript is triggered by a dynamic action, which itself is triggered when a user changes the value of a selection list. Below is the javascript code that is relevant:

    for (k=0; k<active_array.length; k++){
          var request = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=CAL_COLORS', 0);
          request.add('x01', check_array[j]);
           var ajaxResult = ajax.get();
           alert(ajaxResult);
          active_array[k].parentNode.style.backgroundColor=document.getElementById('P14_TEST_COLOR').value;}
    

    And she calls the application process is also shown below:

    declare
    v_color varchar2(20);
    begin
    select color into v_color from cal_colors where other_user = apex_application.g_x01 and user_id = :USER_ID;
    :P14_TEST_COLOR := v_color
    end;
    

    The issue seems to be that online 03 my JavaScript, especially since my array element is not spent properly in my process. In an attempt to debug this, I added the alert message, however, instead of any relevant information, the alert shows just the HTML page! I'm at a loss as to what I'm doing wrong here, so if anyone has any input, I would very much appreciate it.

    Basically, you need to rewrite in the http buffer, using htp.p:

    DECLARE
      v_color VARCHAR2(20);
    BEGIN
      SELECT color
        INTO v_color
        FROM cal_colors
       WHERE other_user = apex_application.g_x01
         AND user_id = :USER_ID;
    
      htp.p(v_color);
    EXCEPTION WHEN no_data_found THEN
      htp.p('white');
    END;
    

    You could potentially make it much more efficient also. At the present time you loop on what is probably an array of elements, so from a tabular form probably. Rather than call an ajax for each line, you can group together them and make a call.

    Example:

    JS, you can use this to create an array with values to be placed on the server:

    var lArray = [];
    $("input[name=f03]").each(function(){
    lArray.push($(this).val());
    });
    

    And you can use the apex.server.process api to call a process on demand:

    apex.server.process("MYPROCESS", {f01: lArray}, {success: function(pData){console.log(pData);}})
    

    As you can see, the table with the values is put in the table in the f01. You must use the option of success well since it will be asynchronous (htmldb_Get.get is a synchronous call).

    With respect to the CLASS code:

    DECLARE
      l_return VARCHAR2(4000);
    BEGIN
      FOR i IN 1..apex_application.g_f01.count
      LOOP
        l_return := l_return || '"VALUE' || i || '",';
      END LOOP;
    
      l_return := RTRIM(l_return, ',');
      IF l_return IS NOT NULL THEN
        l_return := '[' || l_return || ']';
      END IF;
    
      htp.p(l_return);
    END;
    

    It will loop through the items in the table-f01 and build a new JSON notation and write it back to the http buffer so it returns to the client. It will look like this:

    ["VALUE1", "VALUE2", "VALUE3", "VALUE4", "VALUE5", "VALUE6", "VALUE7", "VALUE8", "VALUE9", "VALUE10"]
    

    I say this because when users use your application, you do not want such a quantity of calls. A single call by treatment action would save a lot of resources. You may have to loop twice on your items to apply your backgroundcolor, but I don't voluntarily not too mention jQuery since you is perhaps not familiar with it and get scared by him.

  • Can run us javascript function locally within the amx page?

    Hello

    I am totally new to the features of the MAF, let me just 1 thing right, im familiar with the implementation of javascript as on PHP. For example, (1) you can create a js file in a certain directory of your project as long as you can connect properly. And, on the php page, you link such as)<script type="text/javascript" src="file.js"></script>)to be of use inside of your php page or (2)locally run the javascript function inside your php page such as

    function myFunction(){
      
    Alert("Hello World.");
    }.


    So far what I've done on the tutorial javascript MAF, same case, you need to specify your javascript function inside a .js file and save your js file in your maf function (so that the javascript functions are available and can be called through the java method of AdfmfContainerUtilities.invokeContainerJavaScriptFunction () inside your file of java bean managed). After that, in my case to test the tutorial, I need to create a managed bean method to call the associated javascript function based on my actionlistener to the button that ive created inside my amx page, it didn't work (NOTHING HAPPENED when the button is clicked, as maybe it's because I was wrong by calling the managed bean method or class({viewScope.popupHelperBean.onPopupShowHideAction}). )


    Please follow this tutorial to understand what im referring to topic-> https://blogs.oracle.com/mobile/entry/how_to_open_and_close

    (If someone has already managed to made this javascript tutorial, please inform me so that I can see on my error).


    Now I'm trying a different approach which is to run the javascript locally, it's just that I don't have enough resources that could satisfy my investigation to start with. I met this amx: verbatim terms during my research. Fact amx: verbatim help by running the JavaScript locally.


    Thanks in advance.




    Hello Amey,

    Thanks, I had run successfully the popup alert box based on javascript this tutorial you had linked to me, it seems that I am on the right track on how to run javascript on the page of the amx. Its just that the tutorial I mentioned on my post doesn't seem to work as it should, I'll try to resolve the issues for a while. I just want to share with the community who are new to the MAF and are currently working on the custom javascript on page amx application:

    1. include your js inside your working directory file

    2. Add the javascript code that is personalized to your AMX

    3. create a managedbean and a method that could call the javascript function

    Carefully follow this tutorial as mentioned by Amey have the idea of how the javascript is running on amxpage--> https://blogs.oracle.com/mobile/entry/invoking_custom_javascript_from_an

    By the way, thank you very much Amey.

    Learner90

  • Call a javascript function in the Value attribute of param

    Hello

    I want to put a TLF text field in the SWF file in an HTML page. So I used flashvar, by calling a javascript function to it attribute "value" as follows.

    < param name = FlashVars value = "" + SetFlashMovieParam() + "" id = "message" / > "

    SetFlashMovieParam() is a javascript like the following function.

    function SetFlashMovieParam() {}

    document.getElementById("message").setAttribute ("value", "msgText = Start");

    }

    Even if this does not work, when I put the text value directly to the 'value' attribute, it worked.

    < param name = FlashVars value = "msgText = here % 20is % 20The % 20text" id = "message" / > "

    I think it's because calling a javascript function syntax error in the param tag. Can anyone help to call this function properly...

    Thank you.

    Normally when you have an executable code embedded in the html code you should check that article accordingly.  In the case of javascript surround you with

  • Need to call the javascript function when the page is loaded

    Hello - I have a javascript function defined on Page 0 of my application. It is in the source of an unconditional
    region whose view point is after the header.

    I call successfully the function of event onchange on individual page elements. (The function
    sets the value of an element based on the value of another).

    But I also need to call the function when the page is loaded. The page is a form of data modification,
    so many values is filled when it is loaded, and I need the dependent values populated
    also.

    I tried to add the call to function in the following way. It is not at all get called (alerts are not forthcoming)
    and there is no error in the Firefox error console...
    - as an event onload in individual items
    -call directly to the edit HTML page header
    -call directly from the HTML body of the edit page (which, from what I've read, sounds
    as to execute onload and my page template doesn't have a defined substitution onload string).

    In these 2 cases, I simply call it like: jsLookupValue ($v ("P8_OBJECTTYPE_ID"), "objecttype_id", "P8_OBJECTTYPE_NAME", "objecttype_name", "hdb_objecttype");

    How can I do this?

    Thank you
    Carol

    If you define the function on the zero page and any page you should be able to call using something like:

    
    

    Have you tried to put just a statement alert() on the page in order to check that it runs just about anything?

  • Cannot use the output of javascript function in the scriptlet

    Hi I am using the listboxes in a jsp page. There are 2 drop-down lists.
    Once I click on a particular value in listbox1, the listbox2 is filled according to value in listbox1.

    which means I want to use the value in the list box as parameter 1 to fill the listbox2.

    Note: the values to listbox1 are filled with the values from the table to the oracle database.

    Here is the code I tried to frame.

    I have a listbox with the following code 1

    < select size = "5" cols = "30" name = "view_label" onclick = "testSelect (this.form)" > "

    < SCRIPT >
    function testSelect (form)
    {
    var multipleVar = form.view_label.options [form.view_label.selectedIndex] .value
    If (form.comments.value == "")
    {
    Form.comments.Value = multipleVar + "\n";
    }
    ElseIf (form.comments.value! = "")
    {
    var insertedMultipleVar = form.comments.value;
    Form.comments.Value = insertedMultipleVar + multipleVar + '\n '.
    Form.comments.Value = multipleVar
    }

    }

    < /script >


    It's listbox 2 which is based on option 1 OnClick of the listbox

    < select size = "5" cols = "30" name = "applications" >

    < %
    ResultSet rsetlovp = lovbean.getAllQueries (/ * Function testSelect output * /);
    While (rsetlovp.next ())
    {
    out.println ("< option value =" + rsetlovp.getString ("query_position") + ">" +)
    rsetlovp.getString("query_position") + ' < / option > ");
    } % >
    < / select >


    How can I switch the output of javascript function to getAllQueries() method?

    Please can someone help on this...?

    Thank you
    Ramakrishna

    Published by: user1064313 on July 22, 2009 05:33

    Published by: user1064313 on July 22, 2009 05:42

    It's really a bit difficult to answer your question without a little more information. What version of JDeveloper are you using? What is your technology environment?

    In the case of JDeveloper 11 g + +, with the Fusion technology stack, you can use a technique similar to that described here:
    http://Groundside.com/blog/GrantRonald.php?title=jdeveloper_11_business_services_cascadin&more=1&c=1&TB=1&pb=1

    JDeveloper 10.1.3 with the default Web technology stack, check here:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#62

    If, as looks, it is really a question about generic (no JSF) JSPs, you could actually have a little more success on a generic JSP forum - using scriptlets was not really practical copies within JDev since... Well, since JSTL became available, really. It was a number of years.

    As I said, there is really no direct way to use Javascript in a scriptlet - unless you mean something like store the output of Javascript in a hidden field and using the value in a scriptlet on the next request. But at the point where Javascript executes, a scriptlet for the current request will be already performed.

  • Error when you try to call the Javascript function in the ActiveX Web browser

    I have a requirement to call a Javascript function in a web page that is displayed in the browser's ActiveX control.  I have the control on the front panel, and I use the Navigate method to call to the top of the appropriate page.  Based on an example, I found, I'm trying to get a reference to the HTML Document so that I can then get a reference to the Fenetreparent.  There is a method of the HTML Window object called execScript who I'm calling.  See the attached image of the code (reference close calls do not appear, but when I run it, they are there).

    I can't the node property that returns the parentWindow reference.  The error I get is the following.

    Error-2147467262 LabVIEW: (Hex 0 x 80004002) No. taken such interface supported.

    Any ideas on where to go from here?

    Hello

    I have reproduced the issue and the error you are seen and tried to understand what is the solution.

    It seems that the problem is with getting the pointer to the parentWindow.  From what I read on MSDN, it's maybe a limitation in the use of an ActiveX control in LabVIEW. It seems like Internet Explorer creates the object of the window, and so opening in one ActiveX control you free access to this top-level object.

    Here could be workaround for javascript execution in your program:

    I would like to know if it works for you and if it will work in your program.

  • Flash cannot call the javascript function in the local html file

    Hello!

    Us is to develop our first application on Playbook. It is an html file including a flash file and javascript code. Everything is packed in. in the file bar, a config.xml file and has been correctly loaded into the Playbook. Everything works locally (no web access)

    Everything works well except when we use an ExternalInterface.call("saveglobalscore",score) in flash that calls a javascript function in the .html file.

    In the actionscript3, we selected the "authorized local file access" and put the 'Security.allowDomain("*) '.

    Any ideas? Thank you!

    External interface tries to access the files packaged locally is currently a known issue.  I have not really of a calendar when or if this can be resolved.  It may be in the code base of flash.

  • Calling JavaScript function from c ++

    Hello

    I need to call a function javascript from c++ code. I have a webview in which an html page is opened.

    I can connect to c ++ js using navigator.cascades.postMessage. I have to call vice versa.

    c ++ for js now.

    Concerning

    Hello

    I tried another way of calling JavaScript function continue in every 5 seconds.

    Steps to follow:

    1 import im .js QML file.

    2. create a function in QML and call the java script of QMLfunctuion function.

    3 the signal of the CPP in every 5 seconds and connect this signal to function in QML whare you call java script function.

    4. it indirectly calls the java script function.

    Thank you

    Anand

  • JavaScript function does not work on the JSFF page load but runs on page refresh

    A bit of background first:-I'm a front-end developer who use jDeveloper to build templates/pages. I also manage client scripting using af:clientListerner tags. But my knowledge on the related backend stuff (beans, triggers, actions) etc. is almost zero. So, I'll use technical very simple terms to describe my problem.


    Scenario:


    Let's say I have two pages JSFF, first.jsff , and second.jsff


    In first.jsff, I have a command link that navigates to second.jsff. Inside of this page, I have a javascript function that I need to run when the user interface is rendered. But as soon as second.jsff load, my JS function never fires. Only when I refresh the page see running. This what second.jsff looks like:

    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core">          
       <af:panelGroupLayout id="pgl17" styleClass="mainBox AFStretchWidth">
           <af:resource type="javascript">
                function runOnLoad(){
                      alert("Hello world");
               }
               runOnLoad();
            </af:resource>
            /*   other ADF components go below this line
            .
            .
            .
            */
       </af:panelGroupLayout>
    </jsp:root>
    
    
    

    So I see the alert only when I refresh the page (i.e. after the redirection occurs, I have to refresh the page to make the JS run)

    What I'm missing here?

    jDeveloper version is 11.1.1.9.0

    You will use this fragment of .jsff inside the .jspx page. In the .jspx inside the af: document add clientListener as:

        
          
          .
          .
          .
        
    

    Change the javascript method to be:

     
          function runOnLoad(event)
          {
            alert("Hello world");
           }
     
    
  • Best approach to call a javascript function in a tabular presentation

    Hi all

    I have a manual tabular presentation. In this form, I have a javascript function that disables hiredate column. The function is called on the deptno column change.

    So, if I select the "Research" Department and hire date field is disabled for the selected line.

    I need to run this function also executed automatically on page load. So, it checks if all rows with deptno as search and disable hiredate field for these lines.

    Please let know us the best approach to achieve this goal, which does not affect the performance that the page has 2000 lines.

    function test2 (pThis) {}

    var v_item_value = pThis.value;

    var v_hiredate_item = $(pThis).closest('tr').find ('td [headers = HIREDATE] input [name = f05]');

    var v_hiredate_button = $(pThis).closest('tr').find ('td [headers = HIREDATE] button "");

    var currIndex = $('select[name="'+pThis.name+'"]').index (pThis);

    var currRow = currIndex + 1;

    If (v_item_value == '20') {}

    v_hiredate_item.prop ('readOnly', true);

    v_hiredate_button.prop ("disabled", true);

    document.getElementById("f08_"+[currRow]).disabled = true;

    }

    else {}

    v_hiredate_item.prop ('readOnly', false);

    v_hiredate_button.prop ("disabled", false);

    document.getElementById("f08_"+[currRow]).disabled = false;

    }

    }

    Thank you

    Zkay

    Try this:

    Suppose that the deptno column name is "f08".

    execute a javascript script that triggers the loading of the page

    $("[name=f08]').change ();

  • JavaScript function to page template?

    Hey experts,.

    I have a custom component that substitutes a template page, and this page has a javascript function. Is it possible to remove the function out of the page and simply reference? How could I add a javascript as a resource of the component function?

    Thank you.

    There is an example of using external JavaScript here: https://bitbucket.org/mythics/metadatamultiselectwidget/src/

    Here are some additional resources:

    http://fscherpe.blogspot.com/2012/07/pushing-files-to-Weblayout-from-UCM.html

    http://Techblog.aurionpro.com/2012/12/WebCenter-content-interface-branding_24.html

    Jonathan

    http://jonathanhult.com

  • InDesign CS5 for windows only allow me to scroll through the functions with the mouse wheel

    Nice day

    InDesign CS5 for Windows only allow me to scroll through the functions with the mouse wheel and for example not allow me to access drop down menus, any help will be much appreciated

    https://helpx.Adobe.com/InDesign/KB/InDesign-tools-panels-Don ' t - respond.html

  • Access to the Service of maintenance through Javascript

    Hey guys,.

    Had a problem with access to the service of maintenance through Javascript.

    Let's start first of all, here's the section of code:

    **********************

    var objXMLHttpRequest = new XMLHttpRequest();

    objXMLHttpRequest.open ("POST", "http://localhost:8020/determinations-server/interview/soap/10.4/OPA_IS", false); Point of Service endpoints, synchronous method

    " package of var = ' < soapenv:Envelope xmlns:soapenv = ' http://schemas.xmlsoap.org/SOAP/envelope/ "xmlns:typ =" " http://Oracle.com/determinations/Server/interview/OPA_IS/types ">\

    < soapenv:Body >.

    < typ:open - session-request / >.

    < / soapenv:Body >.

    < / soapenv:Envelope > ';


    objXMLHttpRequest.send (packet);


    **********************

    The ODS with the relevant innterview service has been deployed and I can test this very well through SoapUI. He returned with the correct answer in this casting the Session ID for the new session of the OPA.

    When I run the present thanks to my JavaScript code, I get the following error in my log:

    com.oracle.determinations.server.exceptions.InvalidActionException: no action for 'null' does exist in the service 'odsInterviewService104 '.

    Thus, it seems that it does not find "OpenSession" action that is needed.

    My question is: How to indicate the type of action in my SOAP package?

    I ran across the ODS code and I can see what is causing the error, but everything I try, I can't seem to be able to add action to resolve.

    Kind regards

    Evert

    OK, that is now resolved. Added action and settled the question of calls cross-domain that came after that.

    Everything works now.

    Evert

  • Custom Javascript functions?

    If I wanted to write a small library of javascript functions that I can reuse for each project, where I place my duties?

    I remember somewhere that I can edit a specific javascript file in Captivate files copy in the published version and have my functions always available. Only, I don't remember where this file is kept.

    HTML5

    You must place an include statement in the file index.html here:

    C:\Program Files\Adobe\Adobe Captivate 8 x64\HTML

    Put your JavaScript here file:

    C:\Program Files\Adobe\Adobe Captivate 8 x64\HTML\assets\js\

    SWF

    Put your scripts in this file:

    C:\Program Files\Adobe\Adobe Captivate 8 x64\Templates\Publish\standard.js

Maybe you are looking for

  • Why I get this error memory?

    I have an old imac of five year with all running the latest version of Yosemite and the Suite of Microsoft Office 2011 it's updates.  I am running eight concerts in two slots four memory (i.e. use eight out of a possible 16 concerts.)  I occasionally

  • How is HD 4:3 content?

    I'm used to HD content to display wide meaning. Everything I have ever downloaded/purchased in HD has always been contained pan. Recently returned in the leap forward and I saw that iTunes has HD and SD versions. Was happy to see that there are episo

  • 'Open with '.

    I've written a VI that leans on the MSI files and look at all the data in the database. It is a program and my favorite part was that I could do a right click on a MSI file and say "Open with" and choose my program, and it would open my exe and look

  • Message from Windows XP: Windows Media Player cannot play a DVD because no compatible DVD decoder is not installed on your computer__

    Our computer working again after installing a new hard drive and reinstall all Windows XP Home edition software from disks under Windows license, I got with the computer again. All software updates at the current level (SP3, etc.) have been downloade

  • "Minimize the Image Recovery" since the recovery discs?

    the "reduced Image Recovery" is possible from the recovery discs? Installation win7pro from the recovery disks from HP on an SSD completely wiped for Elitebook 8560p.