Apex Java Script

I want to do a search by empid in emp table.
If no return row, I want to pop up a message for user to select Yes or No.
If user select No, stay at current page.
If user selects Yes, then I should carry this empid to another page to create this empid.
How can do this in Java Script?
How to check if no row return?
How to carry this empid to another page by Java Script?
Where should I control which page to go?
Thank you.
Edited by: user628655 on Oct 9, 2009 7:50 AM

For your first questions;
You can use Ajax to call an application process to validate if you get null rows or not. There are several examples on this forum. You can also look at something like [Carl's Apex|http://carlback.blogspot.com/2008/03/new-stuff-1.html]
With respect to How to carry this empid to another page by Java Script?
Where should I control which page to go?
Once you know if the value is not null, submit a request using doSubmit and then have conditional processes on the page to decide where to go and what values to pass.
Cheers
Kofi
Edited by: Kofi on Oct 9, 2009 8:12 AM

Similar Messages

  • How to write Java Scripts in Apex

    Hi All,
    Can any on tell me how to write Java Scripts in Apex.
    Thanks in Advance,
    Mukund

    If you want to link your custom JavaScripts to an Apex page, you have several options:
    1. Add an HTML Region on Page 0 (Script will be written to every page) called something like "JavaScript & CSS". In this region add your Script to the region source like this:
    <script language="JavaScript">
    function hell ()
    alert ("Hello World");
    </script>
    2. Add a similar region to the page you are working on (can only be accessed on this page)
    3. Create an external JavaScript file and either load it into the WORKSPACE or into the images (/i/) directory on the server. You can then link the JS into you page via modifying the Page Template.
    Hope that makes sense. Let me know if you want any further help with option 3.
    Duncs

  • Run exe file with java script in Apex

    Hello All,
    I have a exe file which I need to perform in Apex. I created a function by java script as fallow:
    function RunEXE()
    var oShell = new ActiveXObject("WScript.Shell");
    var prog = "C:\WINDOWS\test.exe";
    oShell.Run('"'+prog+'"',1);
    Also, I created a button to run this function by redirect to URL as fallow:
    javascript:RunEXE();
    but it does not provide me any answer. Could any one help me on that please!!!!
    Thanks,
    Atousa

    No, they're it's no easy solution in java. However, it's not impossible to decompile an exe file, do there it's no real difference.
    Question is, who goes to the pain of compiling lots of jar files to get to your source code?
    Timo

  • Java Scripts for Apex page

    Hi All,
    i have a Apex page -Report page (having +ve ,-ve numbers)
    i have to change the color of the numbers :
    1)+ve to Green
    2)-ve to Red
    2)rest s to Black
    how can the Java scripts looks likes for below tables structure
    CUSTO   SWITCH       PORT1      PORT2      PORT3                               
    JCI     S1               0          4          3                               
    JCI     S2              -3          3         -8                               
    JCI     S3               6         -7         -5                               
    JCI     S4              -2          0          0                               
    JCI     S5               0          2          0  
    Sum                    1          2         -10
    summation happening by using Apex feature
    Report Attribute->Report column-sum(check box)
    i try to apply the below code in the Region Source of Apex page
    Re: coloring  positive and negetive number of a report
    like this
    SELECT col1,
           CASE WHEN col2 > 0
                THEN '<span style="color:green">'||TO_CHAR(col2)||'</span>'
                WHEN col2 < 0
                THEN '<span style="color:red">'||TO_CHAR(col2)||'</span>'
                ELSE TO_CHAR(col2)
           END col2
    FROM   src_data
    But the problem i am getting is not able apply to the Sum rows(because it happening by using Apex page feature)
    so i want go for Java ScriptsRegards
    Amu

    Hi Amu,
    I don't know if that's the best way to do it, but that's how i handle this:
    I usually copy the report template and name it for the specific region. Then I change it by customizing "After rows" specially for the report, adding something something like:
    <tr>
    <td colspan = "2" class="data" style="text-align: left; font-weight: bold;">Sum</td>
    <td class="data" style="text-align: right;"><div id="port_total"> </div></td>
    <td class="data" style="text-align: right;"><div id = "port2_total"> </div></td>
    <td class="data" style="text-align: right;"><div id="port3_total"> </div></td>
    </tr>I calculate the totals in hidden items on my page and then check them in my javascript and display them in the corresponding <div>s, adding style for the positive and negative colours. Something like
    document.getElementById('port_total').innerHTML = $v('P1_PORT_TOTAL');
    if($v('P1_PORT_TOTAL') > 0) {document.getElementById('port_total').style.color="green";}
    if($v('P1_PORT_TOTAL') < 0) {document.getElementById('port_total').style.color="red";}Regards,
    Vlad

  • How to disable a button using Java Script in Apex

    Hi All,
    I was trying to disable a button when the value of a select list item in the same page is equal to zero. Following are the steps which I did.
    1) Created a new button template as <table class="t9StandardButton" id="#BUTTON_ID#" cellspacing="0" cellpadding="0" border="0" summary="">
    2) Changed the existing button template to the newly created button template.
    3) Added onchange="javascript:fdisplay(this);" to form element value of select list
    4) Added the following java script in the page header
    <script type="text/javascript">
    function fdisplay(some) {
    if (some.value==0){
    html_GetElement ('#BUTTON_ID#').disabled = true;
    else
    html_GetElement ('#BUTTON_ID#').disabled = false;
    </script>
    But the script doesn't work. Is there anything I am missing here. Please advice.
    Thanks,
    Vikas

    Vikas:
    In the 'Button Attributes' field of the button enter 'id='thisButton'.
    Modify the button template to include the substitution string #BUTTON_ATTRIBUTES# . This should be put in the anchor tag in the template defintion.
    Modify your Javascript to reference the above id as
    html_GetElement ('thisButton').disabled = true;
    ....Varad

  • Oracle apex popup using java script in tabular form select list(Am new to apex help me out... )

    Hi ...
      i have a tabular form
      have two columns in that form, kept as a select list by selecting that 1st select list data the related datas has to be popup after selecting that it has to be displayed in the  2nd column by using
    java script
    eg:
    1st column empno-----by selecting the empno the related empname has to be popup
                     dept no....by selecting the deptno the related deptname has to be popup 
    thanks in advance,
    kishore

    This is a very common question, see
    https://forums.oracle.com/thread/2359498

  • Page failure when attempting to save java script in html header

    Currently there is java script code for a function that is seeded in the html header of a forms page by apex when the form is generated. This code is for the chicken test for the DELETE button.
    The function works as designed, but if I try to "APPLY CHANGES" to the the page definition I get the The page cannot be displayed "Cannot find server or DNS Error". "the url is http://nldg-3.appl.devjones.com:7777/pls/apex/wwv_flow.accept" If I remove the script coding from the HTML header the page will save just fine, but of course no more java script.
    I need to add a java script function to the page and I am unable to do so at this time because of this issue. I can reproduce this error on any of the sample apps that I have loaded into apex.
    the Apache error log contains:
    [Fri Feb 13 06:11:06 2009] [error] [client 172.16.85.122] [ecid: 1234527066:192.168.211.127:31922:0:17188,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-500 Error Reading Data from Client!!
    The Apache access gets:
    172.16.85.122 - APEX_PUBLIC_USER [13/Feb/2009:06:23:47 -0600] "POST /pls/apex/wwv_flow.accept HTTP/1.1" 500 653
    Apex is version 3.1.2.00.02 and uses on iAS on a Linux server. The Database is 10g. The browser is IE 6.0.2900.2180.
    I have been developing for about 3 months in Apex and this is the first issue of this kind that I have run into. Any help will be greatly appreciated as I have no clue at this time.

    Luis,
    All the forms are created by Apex with a default function in the html header for a delete chicken test as follows:
    <scrpt language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    Even though the function is already a part of the page, if I try to save it, it will fail. I will look into the "black list" a little deeper. I have asked around abit as I also had suspected that, but so far all the answers were that it should not be a problem. If I take out the "SCRIPT" word I can get the page to save, but of course the code is worthless at that point.
    Keith

  • Java script is not working in custom tabular form

    hai all,
    i have changed my built in tabular form to custom tabular form.my java script is coding working fine in built in tabular form . But in my custom tabular form java script is not working ,since it is created as standard report(Display As).
    pls help me.
    with thanks and regards
    sivakumar.G

    Is the appostrophe function test(pthis) *'* present in your javascript code...
    If not can you post the same in apex.oracle.com and give the credential so that I can the why its not wroking
    Regards,
    Shijesh

  • How to refer an application item in a java script ?

    Hi Friends,
    I have a simple java script for disabling an item as below :
    <script language="JavaScript1.1" type="text/javascript">
        function disFormItems(item1)
          if ($x(item1).value != "")
              disItem = document.getElementById(item1);
                    disItem.style.background = 'beige';
                    disItem.readOnly = true;
    </script>I have an application level item G_BUTTON_FLAG. Based on the value coming into this application item I want to disable the item.
    So I went and changed the script as below :
    <script language="JavaScript1.1" type="text/javascript">
        function disFormItems(item1)
          if ($x(item1).value != "" && $x('G_BUTTON_FLAG').value == "EDIT")
              disItem = document.getElementById(item1);
                    disItem.style.background = 'beige';
                    disItem.readOnly = true;
    </script>Can any one please tell me what am I doing wrong here ?
    Thanks,
    Raj.

    Hi Teku,
    Javascript can only see what is actually on the page - this has nothing to do with Apex, it's just what javascript is designed to do.
    There are two things you can do:
    1 - Add a hidden item to your page and set the application item as its source and then refer to that hidden item instead
    2 - Use Ajax to get the value
    I'd go with the first one as it's the simplest solution.
    Andy

  • How we can handle the below doubt in Java Script!!

    Hi All,
    I need to handle the below scenerio in javascript, i am very poor in scripting langauage could any help me out.
    Below are the three where we have specail character
    words as
    1. transfer (…)
    2. Shell’s
    3. Vitol – as
    The above 3 are having some specail characters which we need to
    replace as mentioned below
    need to use a Function/Method in some scripting language like Java
    script to replace the special character with a predefined sequence eg:
    single quote with “a1b1” before inserting the data in to the data base
    and then while retrieving the record from the database replace “a1b1”
    with single quote.
    Note#:It is a text area where user can either enter or copy and paste
    the content.
    Thanks,
    Anoo..

    Hi Anoo,
    always remember to put your apex and database versions, it makes it easier to help.
    You mentioned stripping out special characters and then putting them back for display. Is there a particular reason why?
    If you're having difficulty querying the 'special' characters from SQL, you can create a view to handle that complexity.
    The examples you gave don't contain any characters you can't query on. Maybe I'm missing something.
    Kofi

  • How to include a common java script in all pages to prevent browser closure

    We have already implemented a script to prevent accidentally browser closure. The script has been included in a js static file and loaded in APEX 4.01.
    There is a way to make the script available to all pages without including it in all pages ?
    Ad example to make an item available to all pages is sufficient to include it in page 0 there is somethings similar for java script
    Txs
    Giuseppe.

    Reference the script via a <tt>script</tt> element in the Header section of utilised page templates.

  • Can a Button call a java script and then proceed with the creation

    Hi all,
    I have a simple APEX form on a table,
    with simple function as create and apply changes,
    some items of the form are computed by a "Computation"
    I need the create button to show the computed values, before move to the next page, then proceed with the creation ( submission)
    I have tried to show the values by a java script, but after clicking the button OK of the javascript msg, no submission performed ,
    details:
    the java script is called in the URL of the Button,
    it only contains a alert statement
    is there a way to let the button do that
    or may be the case could be solved by another idea!!!
    rgrds,

    Hi Varad,
    It is Before header of course. I forgot to mention this.
    Yes, you are right Varad, I have read again the question and seems original request was to show Computation that is done in After Submit, more javascript is required of course.
    One possibility is to create On Demand process called COMPUTEITEM where you compute your item, and in the end of on demand process it prints it
    htp.p(:P1_X)
    Then put in HTML header of your page
    <script language="JavaScript" type="text/javascript">
    function setShowItemSub(pThis){
       var l_This   = $x(pThis);
       var ajaxRequest = new htmldb_Get(null, $v('pFlowId'),  'APPLICATION_PROCESS=COMPUTEITEM', $v('pFlowStepId'));
       ajaxRequest.add($x(l_This).id, $v(l_This));
       var gReturn = ajaxRequest.get();
       alert(gReturn);
       ajaxRequest = null;
      doSubmit('aa');
    </script>And in Button URL textarea put:
    javascript:setShowItemSub('P1_X');
    Then no need in After Submit process anymore
    I have put this now in http://apex6.revion.com/pls/apex/f?p=225:1
    COMPUTEITEM On demand process is :
    :P1_X := :P1_X || ' Added this trail';
    htp.p(:P1_X);Of course, all this should be modified accordingly
    Regards,
    Oleg

  • Problem in calling Java Script and Process at the same time

    Hi Frenz,
    I have a requirement like this. when i press the button a page level process(Not Application level Process) and java script function has to happen. i wrote the Java script function to close the child window and reload the Parent window. I wrote the Process for the Parent window to get the updated screen.
    But the Process is not happening and the only the java script function is achieved.
    Can you suggest any idea to achieve both of the things at the same time?
    Thanks in Advance.....

    See this example:
    http://apex.oracle.com/pls/otn/f?p=31517:93
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to increase font size in Java script alert message

    Is anybody know how to increase font size in Java script alert message
    THanks in Advance ....

    Hi,
    You can NOT do it with Javascript.
    You need an alternative solution: http://www.apex-plugin.com/oracle-apex-plugins/dynamic-action-plugin/popup-box_84.html
    Tobias

  • Java Script With XE

    hi Expert,
    Can You Tell Me how to use Java Script With XE.
    Thanks
    Manoj

    Manoj.
    By the term "Use JavaScript", do you mean how to include JavaScript functions on your page(s) or are you looking for help in what JavaScript can be used for and how to add onclick, onchange events to form elements?
    If it is the former, there are several ways to include JavaScript onto your pages:
    1. Edit your page in the APEX Builder and place the normal syntax into the HTML Header Section i.e
    <script language="JavaScript">
    function hellWorld()
    alert ("Hello World");
    </script>2. Check out this article on how to link in File System based Javascript files: http://djmein.blogspot.com/2007/01/reference-javascript-from-file-system.html
    I hope that gets you started.
    Let me know if you need any more help.
    Duncs
    http://djmein.blogspot.com
    As a courtesy, please remember to mark correct or helpful responses accordingly :)

Maybe you are looking for

  • Funny latency with M-Audio Mobile Pre USB

    Hi, I'm using an M-Audio MobilePre USB interface with Garageband, and I'm 99% certain that GB is doing something funny with latency. I'll record a clip, finish recording, and it'll do some funny compensation where it assumes that there is latency the

  • Ale-idoc  steps

    Hi All, Can any one please give me the step by step ale-idoc toturial.about the steps to send data from one client to other. Regards, bunty

  • Error installing forms 6i

    Error Information on instalation forms 6i: mm60.map(0):FILE_NOT_FOUND while mapping mm60 why resolve this problem?

  • Any software out there to update JDK1.0 source code to JDK1.3?

    Hi, I have some source code written in JDK1.0 and I'm currently trying to update it to JDK1.3 - there are a few classes which are deprecated, such as handleEvent and action. Updating these classes looks like it might be a bit difficult (im not a Java

  • Plz see this and think once..

    hai friends, i got one trouble plz help as soon as u can....imagine i ahve 10000 rows.... i want to upload into one it table and i want to split them into 100 text files..each having the 100 rows...just like splitting them into text files and downloa