Calling java script from a button

Hi,
I have a Form and I would like to let the end-user to confirm some action that was initiated by pressing a button. The best way would be to call Java script, but the button is an 'item' button and not a 'region' button - i..e it is placed between items and not above the region, like Save, Cancel etc.
In case of 'item' buttons I do not have 'Optional URL Redirect' field where to place the javascript call.
Tamas

You can try this..
Instead of using button
Edit the Item to which you want to associate a button.
Go to Element tab
Under Post Element Text enter
</ br> <a href="#" -onclick=call_me() class="t20Button">Click me</a>Note : you need to change class="t20Button", i'm using theme 20 and in that the look and feel of button is derive from t20Button.
remove the hyphen before onclick ..
Regards,
Shijesh

Similar Messages

  • Calling ASP script from APEX button passing Bind variable

    I am looking for some examples or best form for calling asp script from apex button that will pass apex bind variable to asp script to process.
    Thanks,s
    Bob

    I am surprised by the degree of no replies. I have solved this by using asp redirects such as:
    Response.Redirect("test.aspx?UserName="&user)
    My formulated solution contains a page with a manually built interactive report. I have a number of bind variables at the top of the reoprt where users can query the information they want based on desginated database columns for this particular report. Once they have the "manual" interactive report displaying what they want, they click a button where a asp script is called with parameters passed that calls a Java based Crystal Reports plugin with the called correspnding report displayed with passed parameters.
    Works like a charm!
    This solves our reporting needs without having to resort to Bi Publisher (much too expensive) and other third party applications that kinda indicate it can work with apex but provide limited help or best form for doing so.
    Bob

  • How to call Java script from java code?Can Jscript be executed at server?

    Hi All,
    We are using 'WebTrends' tool to analyze our site usage pattern.
    To use WebTrends, we need to :
    1) call Java Script code from the java code
    2)Java script has to be executed at server.
    Please comment on two points mentioned above. If yes, please let me know how to do them?
    Thanks in advnce,
    Regards,
    Ganga

    You can check out Rhino project.
    [http://www.mozilla.org/rhino/]

  • Calling java script from link

    Hi,
    I have a link on the page, when i click on the link i should call java script. Java script is written on page level edit area as HTML text.
    Can you give me the syntax ? how to call that script

    say you had a javascript function defined on or accessible to your current page that looked like this...
    function popupURL(url)
    {w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600");
    if (w.opener == null)
    w.opener = self;
    w.focus();}
    ...you could then call it with a link that looked like this...
    &lt;a href="javascript:popupURL('http://www.google.com');"&gt;Open Google in Another Window&lt;/a&gt;
    ...hope this helps,
    raj

  • Calling java script from  HTMLInputText component of java server faces

    Iam attempting to do some thing like this
    HtmlInputText component = new com.ntrs.wcm.ui.components.inputtext.HtmlInputText();
         component.setId(componentId);
         component.setValueBinding("value",
                   FacesContext.getCurrentInstance().getApplication().createValueBinding(backingBeanEL));
         component.setSize(length);
         component.setMaxlength(length);
    now on the component iam calling the followng jav ascript function
    component .setOnkeydown("DisableCtrlKey(event)");
    The java script
    iam calling is
    function disableCtrlKey(e)
    //list all CTRL + key combinations you want to disable
    var forbiddenKeys = new Array(‘a’, ‘n’, ‘c’, ‘x’, ‘v’, ‘j’);
    var key;
    var isCtrl;
    if(window.event)
    key = window.event.keyCode; //IE
    if(window.event.ctrlKey)
    isCtrl = true;
    else
    isCtrl = false;
    else
    key = e.which; //firefox
    if(e.ctrlKey)
    isCtrl = true;
    else
    isCtrl = false;
    //if ctrl is pressed check if other key is in forbidenKeys array
    if(isCtrl)
    for(i=0; i<forbiddenkeys .length; i++)
    //case-insensitive comparation
    if(forbiddenKeys.toLowerCase() == String.fromCharCode(key).toLowerCase())
    alert(‘Key combination CTRL + ‘
    +String.fromCharCode(key)
    +‘ has been disabled.’);
    return false;
    return true;
    I have this function in the correct js page of my application but the script doesnt get executed and still iam able to do ctrl+v on the text box can anyone suggest waht i might be doing wron

    You can try this..
    Instead of using button
    Edit the Item to which you want to associate a button.
    Go to Element tab
    Under Post Element Text enter
    </ br> <a href="#" -onclick=call_me() class="t20Button">Click me</a>Note : you need to change class="t20Button", i'm using theme 20 and in that the look and feel of button is derive from t20Button.
    remove the hyphen before onclick ..
    Regards,
    Shijesh

  • Calling Java Script from a link

    Does any one know how I can call a JavaScript function when I click on a link in a report. Where would I put the call? Is it even possible?
    Thanks
    Aron

    Hello,
    where specificly (name of fielld) i.......Is this on a report? a list ? just some html in the middle of the page?
    You need to add a little bit more detail on your question.
    Don't skimp on the words we have have plenty of space for the post ;)
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Calling Java Script to open a Map (Like Google Map) from Oracle Forms 10g

    Hello,
    We are on Oracle EBS rel 12, Forms 10g. We have a requirement of calling a Custom Map application (Like Google Maps) from Oracle Forms 10g.
    When the user enters the address like town, city, country etc and clicks on a button there should be a call to this Google Map like application which will pass the co-ordinates (Latittude, Longitude) to the map and shows the place on it. If the user selects a different location on this maps and closes the window the parameters co-ordinates (Latittude, Longitude) should be back in the calling form and this new location should replace the original location.
    I appreciate if I can get some help for the above requirements.
    Thank you.
    GM

    Thank you for your reply. I was reading on the metalink that we could use the to call the java script from oracle Forms 10g (Doc ID 265863.1)
    Example:
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("http://www.oracle.com","","location=no,toolbar=no,menubar=no,status=no,"));self.close()','_blank');
    I tried it but it did not open the any window as it claims. Am I missing anything? Is there any IE related setting which I need to modify for the above to work?
    Regards
    GM

  • Calling java application from Oracle forms button

    Hi all,
    I have a problem. The idea is to call Java desktop application when button is pressed. I have used this (above) line of code, but there is no results. When I start form in local everything is fine but when I start from server it doesn't work. Does anyone has that kind of problem and how is solved?
    Thanks in advance.
    __Code is:__
    DECLARE
    v_path VARCHAR2(1000);
    BEGIN
    v_path:= '\\location\Java_Application.jar';
    HOST(v_path);
    END;

    First, please start here:
    http://blogs.oracle.com/shay/2007/03/02/
    As for what you are doing and the problem, it will be difficult to give an exact reason, but here are a few comments which will apply regardless of the platform, version, and installation type.
    1. In most case, when calling HOST from Forms the shell that is started does not include all of the system environment variables. This means for example, if a java.exe is needed (on Windows), you would need to specify its path as part of the call or use a batch file rather than calling a command or app directly. The batch file would first set all the needed environment variables (i.e. PATH, CLASSPATH, etc)
    2. If you are running a newer version of Forms, you have a middle tier. This is were your HOST call will be executed. So, if you are expecting this to occur on the client it will not work. You would need WebUtil for client side calls.
    3. Calling a network resource (i.e. shared drive) is not permitted on Windows platforms when called from a Windows Service. Doing so can be seen as a security vulnerability. This can be overridden, but I would suggest that doing so is not a good idea. All files needed to run your app should be made available locally. If files exist on a remote machine, they should be temporarily brought to the machine (e.g. using ftp, sftp, etc) where they are needed and removed later if necessary. If you are running a newer version of Forms, the Forms runtime process belongs to a Windows Service, even if indirectly as a child.
    4. Calling a jar directly is not the proper way to call a java app. Refer to the following:
    http://download.oracle.com/javase/tutorial/deployment/jar/run.html

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Calling Java Script Function from Applet

    How can I call the Java Script method from Applet. This should work both on IE and NN running on both Windows NT and solaris. I know it is possible to call the function in Java script using JSObject. But I don't have JSObject at run time. Please let me know how to call Java Script function from applet without using JSObject.

    For Java <-> JavaScript communication in Netscape / Mozilla see:
    http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1014290
    http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html#1008480

  • Calling javaFX script from Java program

    I am trying to call JavaFX script from a simple Java program. code as follows:
    import java.io.*;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineManager;
    public class My{
    public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByExtension("fx");
    try {  
    InputStreamReader reader = new InputStreamReader(My.class.getResourceAsStream("first.fx"));
    engine.eval(reader);
    reader.close();
    } catch (Exception e) {
    e.printStackTrace();
    my first.fx file code is here:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import javafx.scene.text.TextAlignment;
    Stage {
    title: "My First JavaFX Sphere"
    scene: Scene {
    width: 250
    height: 250
    content: [
    Text {
    font: Font { size: 24 }
    x: 20, y: 90
    textAlignment: TextAlignment.CENTER
    content:"Welcome to \nJavaFX World"
    } //Text
    ] // content
    } // Scene
    } // Stage
    I am not able to run My.java. runtime error as follows:
    java.lang.NullpointerException
    Kindly correct me, where I am wrong

    I am able to call .fx file from Java. Thank you all for helping me to resolve this problem
    Regards,
    Ritu

  • Call java method from button in UIX page

    Greetings,
    I want to call a java method from a button on a uix page.
    Does it have to be a submit button or it maybe a simple button.
    If it was from a JSP page, it would be a much more different process ?
    This method should delete a row from another view (View2).
    delete from tableB ta where ta.field1 = &1
    My question is how do I build the method to delete a row and how do I invoke the method using the button ?
    Thanks

    This sounds like a JDeveloper/ADF issue that is not related to JHeadstart. Can you please log a TAR at MetaLink ( http://metalink.oracle.com/ ), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html ?
    Thanks,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Call PERL script from JAVA

    I am facing a problem in running a PERL script in JAVA in UNIX box..
    I am able to call ther perlscript.
    Perl script has
    #! /usr/local/bin/perl
    print "\nEnter Your Name :";
    $name = <>;
    print "\nYour Name is : $name\n";
    exit 0;
    Perl script request for the INPUT(name) .
    My Java program is
    File perlfile = new File("test.pl");
    Runtime runtime = Runtime.getRuntime();
    Process process = runtime.exec("perl "+perlfile);
    Here is the problem tat IT IS says error =2 ..What has to be the solution so tat i can CALL PERL SCRIPT as similiar to running it separatly in prompt { >perl test.pl }
    PLEASE help me on this....

    In the PERL SCRIPT (test.pl)
    LINE 1 : #! /usr/local/bin/perl
    LINE 2 : print "\nEnter Your Name :"; .
    LINE 3 : $name = <>;
    LINE 4 : print "\nYour Name is : $name\n";
    LINE 5 : exit 0;
    When i run this script in perl test.pl in prompt (UNIX BOX), i am gettin the request for name "Enter Your Name:____ " but when i call this script from Java it doesn't request for name and moreover the process doesnt ends (use ctrl+c to come out of the process).When i come out forcefully it shows the ERROR=2.
    My requirement is such tat need to call a PERL SCRIPT from java so tat java process give the control to PERL script and it will continue the process..
    Sample scenario:
    Java move a file and store it in a new FOLDER
    MY perl script will read the file in new FOLDER.
    here the perl script will get the file name for processing... My issue comes here .$name is not be prompted while calling thro java..

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • Calling java script in view

    Hi gurus,
    I am stuck with some issu, here is my issue as fallows
    Scenario:
    I am planning to open outlook client by passing some java script and i want to attach history of the email like same as reply button in MSoutlook
    - To call java script i am using webwidget UI element in WDJ and on action of  button i am calling that java script like as fallows
    String html = ReplyAll_class_j.callActiveXFromHTML(this.wdComponentAPI,"toemail", "fromAdd", "Subject of email",  <html><body>htmlbody</body></html>);
    wdContext.currentContextElement().setHtml(html);
    -  in java class i am passing some java script like as fallows
    public static String callActiveXFromHTML(IWDComponent compAPI,String toMailAddress,String ccEmailAddress,String mailSubject,String htmlBody) {
    Script is here
    the Issue is when i click the button it is not opening the outlook client but it is doing when i am click on the tab to recall the component, I thought it is doing this because i am passing "this.wdComponentAPI" as a parameter, but i dont know other solutions so please help me in this issue
    thanks in advance
    Anu

    Hi,
    I am not sure why is that statement "WE CANNOT CALL JS from WDJ"???? I did that pretty number of time in my developments. Can you please try the below mentioned way...
    Inside your method what ever you write to open the JS window
    String htmlcontent="Your HTML Content";
    try
    byte[] html=new byte [ 4096 ] ;
    html=htmlcontent.getBytes("UTF-8");
    wdContext.currentContextElement().setVaHTML(html);
    IWDWindow win =wdThis.wdGetAPI().getComponent().getWindowManager()
              .createNonModalExternalWindow(WDWebResource.getWebResource(html, WDWebResourceType.HTML).getURL(),"window Name As per your choice");
    win.setWindowSize(600,600);
    win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    win.removeWindowFeature(WDWindowFeature.MENU_BAR);  
    win.show();
    catch(WDURLException url)
    wdComponentAPI.getMessageManager().reportException("WDURLException::"+url.toString(),true);
    Regards,
    SrinivaS

Maybe you are looking for