JavaScript callback on apex.submit)

Request Express 4.2.2.00.11


What I'm trying to achieve:

  • When an I click on a link, the current page must be submitted then after loading open the link in a new tab.
  • Basically I want to simulate when the user clicks a tab, but instead open to a new page.


What I've done so far:

  • I've read about Javascript callback and failed.
  • The link:
<a href="javascript:doSomething(2);">MEMBERSHIP</a>
  • Functions in js:
function submitAndGo(pageNo,callback){
  apex.submit();
  if(typeof callback == "function")
  followLink(pageNo);

function followLink(pageNo){
  var url = 'f?p=&APP_ID.:'+pageNo+':&APP_SESSION.::&DEBUG.';
  var win = window.open(url, '_blank');
  win.focus();
}


  • What's happening:

When I click the link it automatically opens a new tab without waiting for the home page to finish loading (always present).

I managed to do work with javascript. Here's how I did it:

The edited link:

MEMBERSHIP

The edited js function:

function followLink(pageNo){
  var url = 'f?p=&APP_ID.:'+pageNo+':&APP_SESSION.::&DEBUG.';
  var win = window.open(url, '_blank');
  win.focus();
}

I added a selection list with this name: P1_PAGE_SUBMITTED with static values 1 and 0.

I also added this:

$( document ).ready(
  function() {
  var item = $x("P1_PAGE_SUBMITTED");

  if(item.selectedIndex == 0){
  item.selectedIndex = 1;
  apex.submit();
  }
  else{
  alert(item.selectedIndex);
  }

  }
);

Now I can follow the link

I needed the home page to submit everything first as Page 2 (membership) requires a few items on the main page.

The membership tab has already worked for me, but I wanted to add this feature to my users.

Here's an overview of what I wanted (the selection list is now hidden using CSS)

I am always open to other suggestions. I know that my method is a method of 'shortcut '.

Tags: Database

Similar Questions

  • It is possible to change the apex.submit () method?

    Hello everyone,

    It seems that the apex.submit () method always executes a HTTP-POST method. Something like this:


    POST /pls/htmldb_devdb11/wwv_flow.accept HTTP/1.1
    Content-Length: 180
    p_flow_id = 136 & p_flow_step_id = 17 & p_instance = 962043850817501 & p_page_submission_id = 1613388309541601 & p_request = T_ORDERS & p_md5_checksum = & p_page_checksum = 82507D5724D222E8E9BCB19A79C6D62F

    I wish I could change this to a GET, it's something like this:

    GET /pls/htmldb_devdb11/wwv_flow.accept?p_flow_id=136 & p_flow_step_id = 17 & p_instance = 962043850817501 & p_page_submission_id = 1613388309541601 & p_request = T_ORDERS & p_md5_checksum =, & p_page_checksum = 82507D5724D222E8E9BCB19A79C6D62F HTTP/1.1


    Thanks in advance,

    Luis

    Hello Luis,.

    There is a solution that you could use. Edit each template of your website and add the following JavaScript just before the end body tag:

    You can't influence (as I know) how APEX produces chains of substitution #FORM_OPEN # and #FORM_CLOSE #.

    Greetings...

  • custom JavaScripts at the APEX of the upgrade from 3 to 4

    Hello

    I'm referencing external javascripts in my APEX 3.2 applications. Now, I plan to upgrade the engine of 3.2-to-4.0.2.00.07 APEX. I want to confirm the following:

    1. I use the following lot. He will work at the APEX 4? It is appropriate to use html_GetElement('pFlowId').value to APEX 4?
    get < pre > var = new htmldb_Get (null, html_GetElement('pFlowId').value, 'APPLICATION_PROCESS is?', 0); < / pre >

    Can I create JavaScript code following in Page 0 to make it work at the APEX 4?

    < pre >
    function doSubmit (pWhat) {}
    Apex. Submit (pWhat);
    }
    < / pre >

    2. I use "doSubmit('???');" a lot. Should I change it to "apex.submit('???');" after that I upgraded APEX 3 to 4?

    3. when I call JavaScripts to report or select list, I always use the javascript: Pseudo-protocole. For example, it can be like onchange = "javascript:doWhat();" ». Is javascript code: necessary for the APEX 4 Pseudo-protocole?

    Thank you.
    Andy

    1. I use the following lot. He will work at the APEX 4?

    Yes. He included in the library of apex_legacy_4.0.js for compatibility with.

    It is appropriate to use html_GetElement('pFlowId').value to APEX 4?

    N ° it has been replaced by the $x and $v methods and the inclusion of jQuery.

    >
    Can I create JavaScript code following in Page 0 to make it work at the APEX 4?

    function doSubmit (pWhat) {}
    Apex. Submit (pWhat);
    }

    2. I use "doSubmit('???');" a lot. Should I change it to "apex.submit('???');" after that I upgraded APEX 3 to 4?
    >

    doSubmit is included in the library of apex_legacy_4.0.js for compatibility.

    Existing applications should continue to run without modification.

    3. when I call JavaScripts to report or select list, I always use the javascript: Pseudo-protocole. For example, it can be like onchange = "javascript:doWhat();" ». Is javascript code: necessary for the APEX 4 Pseudo-protocole?

    It has NEVER been necessary in the attributes of the event. That's all just wrong.

    See also + {message identifier: = 9326152} +.

  • Set the value of the page elements using apex.submit

    Hey,.

    Does anyone have an idea how to set the value of several page elements using apex.submit?

    Here is my request, she works for this element of the page, but I want to first the value of the other elements of the page (i.e. P30_SHOW_REF) as well.

    select s.nr as NRR, 
    '<input type="button" value="clickme2" onclick="document.getElementById(''BUTTONS'').style.display = ''block'';apex.submit({request:''SET'',set:{''P30_KLT_NR'':'||s.nr||'});"/>' Button 
    from klant s
    

    Thanks in advance!

    Hi Julijan,

    Here is the example:

    apex.submit({
      request:"DELETE",
      set:{"P1_DEPTNO":10, "P1_EMPNO":5433});
    

    Concerning

    J

  • the JavaScript in the Apex 4.2.4 file storage

    Hi all

    I'm a little confused about the JavaScript files are stored in the (4.2.4) Apex.

    Oracle said that we can call a JavaScript file from the Page template:

    001.JPG

    Oracle speaks of CALLING here, but he said nothing about WHEN the .js file is actually stored.

    Therefore, the link so that it is the folder/my_images /...

    But where is this file? Isn't that the same as #WORKSPACE_IMAGES #, where I put my CSS files?

    Thanks in advance for your clarification.

    Hi goodluck247,

    goodluck247 wrote:

    I'm a little confused about the JavaScript files are stored in the (4.2.4) Apex.

    Oracle said that we can call a JavaScript file from the Page template:

    Oracle speaks of CALLING here, but he said nothing about WHEN the .js file is actually stored.

    Therefore, the link so that it is the folder/my_images /...

    But where is this file? Isn't that the same as #WORKSPACE_IMAGES #, where I put my CSS files?

    Thanks in advance for your clarification.

    They (Oracle APEX Dev Team) has documented how to integrate javascript into your APEX application

    Reference: http://docs.oracle.com/cd/E37097_01/doc.42/e35125/bldapp_js.htm#HTMDB05013

    Now, where store the JS/CSS/IMAGE files is your concern. You have three options for this:

    • #WORKSPACE_IMAGES # - components - shared static files, not associated with the request.
    • #APP_IMAGES # - components - shared static files associated with an application
    • #IMAGE_PREFIX #-the path of the file corresponds to images virtual directory Viz/i /. The storage of the files depends on the web server you are using: ADR/OHS/EPG.

    Reference:

    As a general rule, I did the following to the js/css files:

    • If your js/css file is the specific page, upload it to the shared components and also it is especially Page attributes-> section Javascript / CSS-> file URL

    For example:

    #APP_IMAGES#my_custom_page1.js
    
    • If your js/css file is required in the entire application, transfer on components/web shared server (Pictures folder) and include this is the reference in the Page template.
    
    

    NOTE: I prefer to keep level application files as well in shared components like this help to application deployment.

    As an APEX 4.2 update it is another option refer you js/css files application (instead of changing the page template), Application-> shared-> attributes of User Interface components. You can consult the js/css files in the sections for 'File URL':

    For example:

    #APP_IMAGES#custom.js
    

    I hope this helps!

    Kind regards

    Kiran

  • APEX submit changes to the database when the value is changed in Javascript?

    Hello

    IM new at the Apex and use v4.1.

    What I want to do, is to have a tabular presentation that will have 5 fields and a number of fields only reading based on a SQL table & reviews, when a user updates one of the 5 fields entry I want to save the change to the databases automatically.

    I thought that this could be done using Ajax and Javascript, but my knowledge is not at a high enough level to make it work.

    I think what I need to do:

    1 create an AJAX callback process (say its called "Submit Changes") - it comes to PL SQL that will update the database based on the value of the field that was changed. I think that this will require the number of line in table form to pass in.

    2. create a header HTML with Javascript code that calls the recall AJAX process - I found the below on the net, but do not think that I changed it correctly:
    < script type = "text/javascript" >
    function Submit_Value() {}
    var ajaxRequest = new htmldb_Get (null, & APP_ID., 'APPLICATION_PROCESS is Submit Changes', 0);
    var ajaxResult = ajaxRequest.get ();
    Alert (ajaxResult);
    }
    < /script >

    3. change the attributes of elements ' "on the column compared to something like onchange ="Submit_Value () ";

    So far I have not been able to get this working and would be grateful for any help or suggestion.

    Thank you

    Goes

    just a quick thought: I myself remember in 3.x days by using a process with a space name did not work (at least when I was trying to use), I have always since then named such with underscores in the... IE: submit_changes the two (the name of the process in the apex) and the reference of the code in javascript

  • displaying a message in apex.submit({request:"submit",showWait:true});)

    Hi all

    my query is

    is it possible to display a custome message in

    Apex. Submit({Request:"INTER_STATUS",showWait:true});)

    in javascript called

    in the html page header, I put

    < script type = "text/javascript" >

    val() function

    {

    Apex. Submit({Request:"insert1",showWait:true,ShowMessage:'hi'});)

    }

    < /script >

    and asked the button

    JavaScript: val();

    works well, but how do I display a message personalized with her as

    "the course application"

    Why? It already shows an icon of treatment which means 'ongoing'

    You can try

    #apex_wait_popup:after {
      content: "In Progress";
    }
    
  • Tutorials for HTML 5 and Javascript to use APEX 5

    Hi guys,.

    Ask any good ebook or online tutorial where I can learn how to use HTML 5 and Javascript with APEX 5.

    Thank you

    Hi edy12,

    edy12 wrote:

    Ask any good ebook or online tutorial where I can learn how to use HTML 5 and Javascript with APEX 5.

    HTML5 is already used in some of the themes in Oracle APEX 5. (namely HTML5 themes introduced in APEX 4.2 + universal theme in APEX 5.0)

    Learning HTML5 and JavaScript, there are a lot of online resources like this:

    Also, you will find good books for HTML5 and JavaScript. In addition, having learned HTML and JS, you can navigate on jQuery and CSS tutorials like these two are also needed to develop applications APEX 5. As these (HTML, JavaScript, jQuery and CSS) are web development of basic technologies, learn which will give you good understanding about the structure and behavior of the HTML page and edge to customize themes and templates in your APEX application.

    Kind regards

    Kiran

  • problem using Javascript window.open Apex 4.2

    I'm trying to use javascript to open a new window in Apex 4.2

    When the user clicks a button on the item, I want to open the page in a new window

    That's what I coded:

    On the button

    under "the ACTION ONCE the BUTTON has been CLICKED" I select "redirect url".

    then enter this: javascript: window.open ('f? p = A:P: & SESSION.) ") ;  where A is the number of the application and P is the page of the application

    This method works.

    Click the button and a new page opens

    the problem is that the old page; the one I was on, disappears. It becomes a blank page with "[object]"displayed in the top left corner, nothing else on the page.

    Is there another way to do this?

    Try wrapping it in a vacuum similar to this:

    JavaScript:void(Window.Open...);

    or to add with

    Returns false;

    as

    JavaScript:Window.Open (...); Returns false;

  • /Apex/apex_authentication.callback at Apex 4.1.0.00.32

    Hi all
    Please let me know if /apex/apex_authentication.callback URL is not called in version 4.1.0.00.32 for the collection of the credentials of the Apex?

    I am trying to use the "HTTP header Variable" authentication scheme with my Access Manager. I have another local Apex environment where I am able to see that this URL is called during authentication.

    For this reason, my access management solution works with 4.1.1 and not 4.1.0.00.32. I have to use the 4.1.0.00.32 Apex version environment.

    Please comment. Thank you!!

    This is a known bug. See the thread for more details:
    Re: HTTP header Variable

    This problem is fixed in 4.1.1 or you can ask the Group of hotfixes:
    12955671 HTTP HEADER VARIABLE AUTH: REDIRECT INFINITE IF USERNAME IS CASE SENSITIVE

  • Test JavaScript to an Apex null field

    Here is a javascript code for w3schools.com illustrating the boolean valueOf method.

    < html >
    < body >

    < script type = "text/javascript" >

    var vamount = 8
    var bool = new Boolean (vamount);
    document. Write (bool.valueOf ());

    < /script >

    < / body >
    < / html >

    When you run this code in the box 'try' to w3schools, the result pane shows the bool.valueOf () to be 'true '.

    I want to use javascript in a page of the APEX to execute a command if a field is not null. First of all, I would assign the value of the field to a variable (in the example below, "vamount"). Then I put this variable in this line ("bool var = new Boolean (vamount)". In the w3schools site, using the "document.write (bool.valueOf ()) ' returns 'true' in the results panel. So, I guess, the Boolean value is true.

    The question is how do I execute a command or another based on the Boolean value is true or false.

    I tried the following on the w3schools site, but it doesn't work:

    < html >
    < body >

    < script type = "text/javascript" >

    var vamount = 8
    var bool = new Boolean (vamount);
    If (bool.valueOf () == true
    document. Write (bool.valueOf ());

    < /script >

    < / body >
    < / html >

    What can I do to make this work?

    Hello! Try this:

    var vpaynum = $v ("P64_PAYNUM");
    var vamtone = $v ("P64_FIRST_PAYAMT");
    If ((vpaynum == 1) & (! vamtone)) {}
    $s ("P64_PMTAM", vamtone);
    }

  • How the file CSS &amp; JavaScript work in APEX

    I'm new to the concept of CSS and Javascript.

    I have after the query.

    1. I have to set my standard application in terms of font size, color, etc...
    What is the best way to do it... should I create a CSS file, and put all my styles out there and then use them in all the
    Pages using the entire application.

    2. it is by default we have one CSS file for each theme, that is to say CSS file of specific theme or application specific, if I want to
    create my own css file it will be ovveride the default. [can we have more than a single css file in an application]

    3. How can I see the APEX default CSS file.

    4. regarding javascript, where should I define javascript functions, if I use this func in most of the pages with the application.

    Someone can also me proven documentation link for - How to use CSS and Javascript in APEX.

    Thank you
    Deepak

    Hello

    In fact, I don't know why you use WORKSPACE_IMAGES instead of APP_IMAGES - what is just like that! This does not mean that other applications will automatically get the style sheet, as this would occur only if you have linked to the style sheet in their page designs

    Apex javascript and theme css files must be stored in the server your /images/ folder structure. If you use FireFox and the developer toolbar, you can use this to see the contents of the file. There is probably something similar in IE, but I only use too, so not sure what that snap would be ;)

    For multiple files, this shouldn't be a problem. For javascript files, the only question would be if you named one of your functions exactly the same as in the scripts of the Apex. In this case, it is likely that the second function would be used. There may also be a small problem with the names of variables (for example, var x ;) set outside the funtion blocks as you cannot set these two times.

    For files css, normal css rules apply when there are multiple instances of the same style - see: [http://www.w3.org/TR/CSS2/cascade.html#cascade]

    Basically, if you have:

    .x {color:red; border:1px solid blue;}
    

    followed by:

    .x {color:black; background-color:yellow;}
    

    True style applied the class name 'x' would be:

    .x {color:black; background-color:yellow; border:1px solid blue;}
    

    but, if you still want red text, you can override this by updating the first statement above to:

    .x {color:red!important; border:1px solid blue;}
    

    so, the result will be:

    .x {color:red!important; background-color:yellow; border:1px solid blue;}
    

    Note also that, if the class name of 'x' has been applied to a TD tag, and you have the following style somewhere:

    TD {font-size:12pt;}
    

    This would also apply, so the result would be:

    .x {font-size:12pt; color:red!important; background-color:yellow; border:1px solid blue;}
    

    This means that if, for example, you used the theme 1 of your application, you can override any of the styles using the style sheet of the theme with one of your own to apply a style to the class a topic 1. Tell him you want to change the style of t1Header of the theme used on a Standard report - you only need to do:

    .t1Header {background-color:pink}
    

    It is better not to override the styles that style a tag type (as in the example above of TD) as they apply to all the instances of this type of tag in the page - and this can cause unwanted results. If possible, stay with class names or ID values: for in a style class names, add a point in front of the name (as shown in the examples above for the class 'x'); for the ID values, use the symbol # (for example, #P1_ITEMNAME).

    All other styles for t1Header will remain the same and, more important still, you don't have to recreate every single style in the theme just to make this change.

    Finally, you can have as many javascript and css files as you wish. Each page template could bind to any of these, if you do not have to include all of them on each page - only those which are necessary for this model.

    Andy

  • JavaScript JSON and ApEx integration

    In the community of ApEx, I see a lot of developers to extend their applications with JavaScript and JSON libraries. I would do the same thing to enjoy all the beautiful widgets, gadgets and gizmos that have been developed in the world of script.


    What is advice to better introduce the use of a script library?

    Team ApEx Oracle has an official thought on the extension of the ApEx in a script library?

    Y at - it a library which is recommended?

    Team ApEx does intend to extend their own library users don't need to use 3 parties?

    Have others using these issues experienced the 3rd-party libraries related to upgrades of the ApEx?


    I need a solution that is solid as a rock (no bugs) and bearable. The apps I support now have over a thousand users. Applications run on our company intranet. It would be undesirable to make calls outside our network http.

    Kind regards
    Todd

    Todd,

    We have certainly will continue work on the library, with the main objective on the realization of full namespace (to reduce the risk of collisions with different libraries functions) and the integration of jquery (making use of the features of the great library of basic such as chaining DOM selectors, improved, etc., but not of jquery UI).

    While it is currently possible to integrate with other libraries and many people have had great results with it, there are other plans for the future which should make life easier. To know custom item types, which allows developers to more easily code and reuse 3rd widgets to party in their applications.

    Another plan is what we call "Dynamic action", which will allow developers to set declaratively in the APEX for example activation, deactivation, display client side logic and hiding items. It is about making life easier for developers who do not want to dirty their hands with JavaScript, but still want to achieve such functionality in their applications.

    But I do not think that we could reach a point where "users have no need to use 3 parties. We are not all things to all people, different people have different requirements and tastes. For this reason, providing the best scalability (through custom item types) is the goal.

    We will also improve the documentation on the library, since 3.1, we had a few docs in chapter API user guide, but we will look to improve it with more detailed in future examples.

    Hope this helps,
    Anthony.

  • JavaFX with Google Maps and JavaScript callback

    Hi all

    I wanted to create an application in javafx where use can click on the google maps map and the application will save the x - y coordinates. I found this

    Article on the experience of java fx cards in JavaFX 2.0 / / JavaFX News, demos and Insight / / FX experience and that worked very well. But this example

    does JavaFX to javascript.

    Now, I added this method to their java script:

     google.maps.event.addListener(document.map, "click", function(event) {
        var lat = event.latLng.lat();
        var lng = event.latLng.lng();
        // populate yor box/field with lat, lng
        alert("Lat=" + lat + "; Lng=" + lng);
    });
    

    and it works if I call the page html by itself. But if I click on the card inside my javafx application, no popup will appear. That, probably something with the webengine

    but I don't need the popup, I need information lat and LNG in my java fx application.

    Anyone have an idea how to realize that?

    Thank you

    Hauke

    See this section of the tutorial.

    Also, since you mentioned that the alert box has not been indicated, if you don't want this feature at some point, you can register a handler with the WebEngine onAlert.

  • Apex. Submit in javascript do not set a value for the element

    Hi all
    I work with Application Express 4.1.1.00.23.

    I am trying to use this
    apex.submit({request:parRequest,set:{'P30_SELECTED_ROW_ID':parID},showWait:true});
    in order to assign a different value to P30_SELECTED_ROW_ID, and depending on demand, run the processes corresponding, but even if the beginning of the process correctly the value of the element sucks.

    I also try to call the apex.submit using a javascript function to check the parameters passed and the value of Thierry is correct and NON NULL .

    Thanks in advance for any help or suggestion.
    Alex

    Hello

    article P1_SELECTED_ROW_ID is about to "view only".
    If you replace this 'hidden' and unprotected, it should work.

    But because of the check constraint DEMO_CUST_CREDIT_LIMIT_MAX credit_limit<= 5000="" there="" will="" be="" an="" error="">

    Good luck, Erik-jan

Maybe you are looking for

  • Scan does not work on hp 3054

    Failed to get scan to work on hp 3054 with mac os El Capitan

  • Satellite L750D - 14Q - nothing happens by pressing FN + 1, 2, 3, or 4

    Hey When I use the FN key and and F1 - F9 shortcut buttons is not a problem.but when I use FN + 1, 2, 3 or 4, that nothing is happening.Especially 3 and 4 would be nice because they sound up and down buttons. Someone at - it an idea how to solve this

  • Several sounds of Notification Mail

    I have three separate e-mail accounts for the different members of the family. Is it possible to have sound notification email for each account. If not, is there an app that could provide the different sounds. Thank you Don

  • How can I add an ICC profile to El Capitan?

    Sometimes, one wonders just what think Apple... In OSX 10.11 El Capitan, the location of the profile used for twenty years is not accessible to the user. Therefore, it is possible to try to stick a profile in the standard location! It of really insan

  • Photoshop Elements will not be printed for Officejet Pro 8550

    I sent this e-mail to HP and Adobe in the hope of finding a solution. Ask help from anyone. And Yes, 8550 is my default printer. I have problems with the software compatibility between Adobe Photoshop Elements 8.0 and the software for the HP Officeje