Call function from button

hello, i have a jsp page and i want to call a java function when the user presses a button, how can i do that? Thanks

Yes, I already have the button in a form. Have a look at my source code
<form name="form1" method="post" action="">
<p>
<input type="file" name="filePath" >
          <input name="OK" type="button" value="OK" onClick="<% readFromFile(request.getParameter("filePath")); %> "> //readFromFile is the function i want to call
     </p>
</form>
What am i doing wrong?

Similar Messages

  • Calling functions from buttons

    Hi, I'm using Flash CC HTML5 canvas and I can't seen to get a button to call more than 1 function. This is a simple example of what isn't working for me:
    Example
    stop();
    function After_Char_Picks()  {
      this.P2_Picks.gotoAndStop("hide");
      this.Choose_Ins.visible = true;
    this.P2_Picks.Rita_btn2.addEventListener("click", Set_P1_Rita2.bind(this));
    function Set_P1_Rita2(){
      this.P2.Player.gotoAndStop("Rita");
      After_Char_Picks();
    Not sure what I need to do to get the button here to call After_Char_Picks(); as well as Set_P1_Rita2();
    Any help is greatly appreciated.
    Thanks,
    Dan

    Thanks for the reply.... Not sure what's going on here, but the alert comes up just fine for the other function. However other objects will not receive commands.  "this.P2_Picks.gotoAndStop("hide");" never gets executed.
    I have read something about functions having scope and the return function is needed to share things like variables outside of the function. But I'm trying to direct movieclips in my HTML 5 canvas page from the function and I don't see how I would apply a return function to telling a movieclip what to do.
    This doesn't make any sense to me as the function linked to the "addEventListener" works fine for any command I put toward a movieclip. What's going wrong in the second if it is being called?

  • How to Call Function from SAPSCRIPT

    I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this

    Hi Nandan,
    U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example
    u need to write this code in SAPScript
    PERFORM formname IN PROGRAM includename
    USING &field1&                                      
    USING &field2&                                      
    CHANGING &field3&                                     
    ENDPERFORM                                               
    Here includename is your include type program.
    u need to write this code in your include type program..
    FORM formname TABLES in_par STRUCTURE itcsy
                            out_par STRUCTURE itcsy.
    data : var1 like field1,
           var2 like field2,
           var3 like field3.
      READ TABLE in_par WITH KEY 'field1'.
      CHECK sy-subrc = 0.
      var1 = in_par-value.
      READ TABLE in_par WITH KEY 'field2'.
      CHECK sy-subrc = 0.
      var2 = in_par-value.
    now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.
    After processing on VAR3...
      READ TABLE out_par WITH KEY 'field3'.
      out_par-value = VAR3.
      MODIFY out_par INDEX sy-tabix.
    EndForm.
    Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.
    I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.
    And yes if this works than dont forget to give the points.
    Regards,
    Sagar

  • Call function from data base with clob input parameter.

    Hello,
    In this project I use Jdev 11g.
    I call function from database.
    create or replace function get_fa_list (
    p_fa_id_list in clob
    return sys_refcursor
    is
    vCursor sys_refcursor;
    begin
    put_msg ('begin');
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;
    put_msg ('Save');
    open vCursor for
    select rownum as id, s.*
    from (
    select f.latitude, f.longitude, count (distinct f.res_id) as res_count, count (*) as fa_count, 16711680 as color, res_concat_distinct (f.res_id) as station_list
    from mv_frequency_assignment f, table (SplitClob (p_fa_id_list, ',')) l
    where f.ext_system = 'BI' and
    f.ext_sys_id = l.column_value
    group by f.latitude, f.longitude
    ) s;
    put_msg ('Open and End');
    return vCursor;
    end get_fa_list;
    I use TopLink in ejb.
    i use follow code for call function and get result.
    public List<TmpResPoints> findAllPointsBI(String p_id){
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.beginEarlyTransaction();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setProcedureName("get_fa_list");
    call.useUnnamedCursorOutputAsResultSet();
    ClobDomain c = new ClobDomain(p_id);
    //System.out.println(c.toString());
    call.addNamedArgumentValue("p_fa_id_list", c);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(TmpResPoints.class);
    query.setCall(call);
    List<TmpResPoints> result = (List<TmpResPoints>)uow.executeQuery(query);
    uow.commit();
    uow.release();
    return result;
    But size parameter "p_fa_id_list" is 0. (geting from temp table in Data base). this code in function >>
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;)
    How I can call this function from dataBase and get result?
    thx,
    Demka.

    What is the SQL generated?
    The argument should just be the Clob value (a String) not the domain object.
    Also try addNamedArgument, and then pass the named argument to the query.
    James : http://www.eclipselink.org

  • Send data to ECC table through RFC Call function from SAP B1 via  b1if

    Hi,
    I have created scenario in B1if which triggers from SAP B1, now I have to send this data in to ECC table, so I have created scenario for that with inbound SAP B1, outbound void and in process RFC Call atom is there but I am not getting data in receiver and also how to write xml to send data in RFC function. Function for RFC has configured from ECC end and have access of that function.
    So please help me to send data to ECC table through RFC Call function from SAP B1 (9.0) via b1if
    Thanks

    Solved by my own.

  • Call function from FM

    hi, how do i call a function from the function module and use it accordinly? i need call the EDITOR_SYNTAX_CHECK from the FM and use it in my program to check abap syntax that users entered.
    pls provide codes.
    thanks. will reward if useful.

    thanks for all of ur replies.
    I have a text editor that allows users to enter abap codes and when they clicked on the save button, the program will check the syntax they have entered and prompt them accordinly. how can i call the EDITOR_SYNTAX_CHECK fm and used it for my program?
    below is my codes:
    REPORT  ZEVONNE_DYN.
    TABLES: ZPROGRAM_TABLE.
    DATA: ITAB_PROGRAM TYPE TABLE OF ZPROGRAM_TABLE WITH HEADER LINE.
    DATA: CODE_EDITOR_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          CODE_EDITOR TYPE REF TO CL_GUI_TEXTEDIT.
    DATA: WA_PROGRAM LIKE LINE OF ITAB_PROGRAM,
            g_ok_code LIKE sy-ucomm,         " return code from screen
            g_repid LIKE sy-repid.
    DATA: st_head TYPE thead,
          i_tline TYPE STANDARD TABLE OF ZPROGRAM_TABLE,
          wa_tline TYPE ZPROGRAM_TABLE.
    TYPES: BEGIN OF DYN_CODE,
            LINE(255),
          END OF DYN_CODE.
    DATA: DYN_CODE_TABLE TYPE TABLE OF DYN_CODE,
          wa_lv LIKE LINE OF DYN_CODE_TABLE.
    CONSTANTS: CODE_EDITOR_LENGTH TYPE I VALUE 255.
    DATA: BEGIN OF CODE_EDITOR_LINE OCCURS 0,
            PROGRAM_CODE TYPE ZPROGRAM_TABLE-PROGRAM_CODE,
          END OF CODE_EDITOR_LINE.
    TYPES: BEGIN OF CODE_EDITOR_TABLE_LINE,
             LINE(CODE_EDITOR_LENGTH) TYPE C,
           END OF CODE_EDITOR_TABLE_LINE.
    DATA: CODE_EDITOR_TABLE TYPE TABLE OF CODE_EDITOR_TABLE_LINE,
          CODE_EDITOR_CONTENTS LIKE STANDARD TABLE OF LINE.
    DATA: INSERT_COUNTER TYPE I, INSERT_VALUE(CODE_EDITOR_LENGTH) TYPE C,
    GT_HEAD LIKE THEAD.
    *ID
    DATA l_number TYPE i.
    DATA l_number2 TYPE i.
      DATA: im_cpidentmax LIKE ZPROGRAM_TABLE-PROGRAM_ID.
    *End ID
    SELECT * INTO TABLE ITAB_PROGRAM FROM ZPROGRAM_TABLE.
    START-OF-SELECTION.
      CALL SCREEN 9000.
    MODULE STATUS_9000 OUTPUT.
    SET PF-STATUS 'SCREEN_9000'.
    SET TITLEBAR 'TITLE_9000'.
      IF CODE_EDITOR IS INITIAL.
        CREATE OBJECT CODE_EDITOR_CONTAINER
           EXPORTING
             CONTAINER_NAME = 'GEN_CODE'
           EXCEPTIONS
             CNTL_ERROR = 1
             CNTL_SYSTEM_ERROR = 2
             CREATE_ERROR = 3
             LIFETIME_ERROR = 4
             LIFETIME_DYNPRO_DYNPRO_LINK = 5.
             CREATE OBJECT CODE_EDITOR
          EXPORTING
            PARENT = CODE_EDITOR_CONTAINER
            WORDWRAP_MODE =
            CL_GUI_TEXTEDIT=>WORDWRAP_OFF
              CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
            CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
            WORDWRAP_POSITION = CODE_EDITOR_LENGTH
            WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.
      ENDIF.
    ENDMODULE.                    "STATUS_9002 OUTPUT
    MODULE USER_COMMAND_9002 INPUT
    MODULE USER_COMMAND_9000 INPUT.
       CASE SY-UCOMM.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'SAVE'.
           MESSAGE S000(ZMSG02).
        WHEN 'LOAD'.
        send table to control
          CALL METHOD CODE_EDITOR->set_text_as_r3table
              EXPORTING
                  table = DYN_CODE_TABLE
              EXCEPTIONS
                  OTHERS = 1.
          IF sy-subrc NE 0.
            CALL FUNCTION 'POPUP_TO_INFORM'
                 EXPORTING
                      titel = g_repid
                      txt2  = space
                      txt1  = text-004.
          ENDIF.
      no flush here:
      the automatic flush at the end of PBO does the job
      ENDCASE.
    ENDMODULE.                    "USER_COMMAND_9002 INPUT

  • Call function from layer0 through layer1

    If I have a flash0.swf and it is on layer0 in VB, and then flash1.swf and it is on layer1 in VB. Then how would I call a function from  flash0.swf through flash1.swf?

    Okay, Here is my code for VB:
    _flashx.LoadMovie(0, Applciation.startupPath & "\main.swf")
    _flashx.LoadMovie(1, Applciation.startupPath & "\addon.swf")
    then in addon.swf I have:
    I created a button symbol and its instance name is mybutton, its an actionscript 2, since main.swf is actionscript2.
    The code for the button is:
    mybutton.onRelease = function() {
         _level0.conn.loadMenu(1);
    When I click the button, when both swf's are loaded into VB on layer 0 and layer 1, nothing happens when I click the button.

  • Calling function from html tag in dynamic textfield

    Hi!
    Tried several approaches for making this happen, but can't seem to do it. I could really use an example of how to do this in my particular case, since I'm not exactly a code - guru.....
    I have a sprite menu which populates a dynamic textfield  with textlabels as users click individual items in the menu in addition to ordinary actions(gotoAndStop).
    As these labels appear in the textfield, I want to be able to link them to the frames assosciated with the menu - item frames. As you can understand from this, I am working with the timeline.
    By enabling  html rendering of text in the textfield, I have been able to link these output labels via a  a href - tag, but I am not able to call a function from this html. The function I am trying to call uses a switch statement to take the appropriate actions according to which label is being clicked, but the only effect I get is the html opening a browser window...... Unfortunately I do not know how to explain this any better, but here is my code for the following:
    Main Timeline, frame 1, actions layer:
    [AS]import flash.display.*;
    import flash.events.*;
    import flash.display.Stage;
    var buttonTrace:TextField;
    var sectionNames:Array = new Array("Frontpage","Introduction",
    "Designparadigm", "Tooling", "Maya & c++ API", "Geometric Vectors","Lindenmayer systems","Artificial Life",
    "Projects","Litterature","Disclaimer","Site credits","Newsletter & Rss",
    "Blogging","Plugins","LINKS");
    var sectionCount: int = sectionNames.length;
    var menu:Sprite = new Sprite();
    menu.x = 452;
    menu.y = 172;
    this.addChild(menu);
    buildMenu();
    function buildMenu():void {
    for(var i:int=0; i < sectionCount ; i++){
    var item:MovieClip = new MenuItem();
    item.labelName = sectionNames[i];
    item.targetClip = this;
    if(i<4){
    item.y = i*125
    menu.addChild(item)}
    else if (i>3 && i<8){
    item.y = (i-4)*125
    item.x = 125
    menu.addChild(item)}
    else if (i>7 && i<12){
    item.y = (i-8)*125
    item.x = 250;
    menu.addChild(item)}
    else if (i>11 && i<16){
    item.y = (i-12)*125
    item.x = 375
    menu.addChild(item)}
    }[\A]
    Then, for the movieclip called MenuItem, I have button placed on the first frame of the timeline, and this code in the actions layer:
    [AS]import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.display.Stage;
    import flash.text.TextField;
    import flash.events.Event;
    import flash.events.TextEvent;
    var buttonTrace:TextField;
    var labelName:String;
    var targetClip:MovieClip;
    clickButton.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(evt:MouseEvent):void {
    trace(labelName);
    targetClip.gotoAndStop(labelName);
    MovieClip(root).buttonTrace.appendText("\n" + labelName);
    MovieClip(root).buttonTrace.addEventListener(TextEvent.LINK,linkHandler);
      function linkHandler(linkEvent:TextEvent):void {
      switch (linkEvent.text) {
      case"Introduction":
      var text= "Introduction";
      text.addEventListener(TextEvent.LINK,"Introduction");
      trace("Listening");
       Intro();
       break;
      case "Designparadigm":
       DP();
       break;
      case"Tooling":
       Tooling();
       break;
      case "Maya & c++ API":
       MayaAPI();
       break;
      case "Geometric Vectors":
       GeometricVectors();
       break;
      case "Lindenmayer systems":
       Lsystems();
       break;
      case "Artificial Life":
          AL();
       break;
      case "Projects":
          Projects();
       break;
      case "Litterature":
          Litterature();
       break;
      case "Disclaimer":
          Disclaimer();
       break;
      case "Site credits":
          Sitecredits();
       break;
      case "Newsletter & Rss":
          Rss();
       break;
      case "Blogging":
          Blogging();
       break;
       case "Plugins":
          Plugins();
       break;
      case "LINKS":
          LINKS();
    function Intro():void {
    targetClip.gotoAndStop(2);
    function DP():void {
    targetClip.gotoAndStop(3);
    function Tooling():void {
    targetClip.gotoAndStop(4);
    function MayaAPI():void {
    targetClip.gotoAndStop(5);
    function GeometricVectors():void {
    targetClip.gotoAndStop(6);
    function Lsystems():void {
    targetClip.gotoAndStop(7);
        function AL():void {
    targetClip.gotoAndStop(8);
    function Projects():void {
    targetClip.gotoAndStop(9);
    function Litterature():void {
    targetClip.gotoAndStop(10);
    function Disclaimer():void {
    targetClip.gotoAndStop(11);
    function Sitecredits():void {
    targetClip.gotoAndStop(12);
    function Rss():void {
    targetClip.gotoAndStop(13);
    function Blogging():void {
    targetClip.gotoAndStop(14);
    function Plugins():void {
    targetClip.gotoAndStop(15);
    function LINKS():void {
    targetClip.gotoAndStop(16);
    MovieClip(root).buttonTrace.htmlText="<a href=\'function:linkHandler,?????'>History</a>";
    [\A]

    as3 textfields have a TextEvent.LINK you can use.

  • Calling function from list of values section?

    can i call a function from list of values(LOV) section as well? I know we can sql query but udf is supported?

    See this recent thread: Display as Text (LOV) or join
    Scott

  • Calling function from PL/SQL block

    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?

    user610868 wrote:
    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?Hello
    A very very basic thing to do when you get an error is to include details of it. That helps narrow it down from one of the 1000s of potential Oracle errors it could be.
    Anyway, a function returns a value, and in PL/SQL you need to capture that otherwise you'll get "an error". Modify your code like so
    DECLARE
       l_Test1Val     VARCHAR2(4000); --CHANGE THIS TO BE THE SAME AS THE RETURN TYPE FOR YOUR FUNCTION
    BEGIN
       l_Test1Val :=  TEST1(1202);
    END;HTH
    David
    Edited by: Bravid on Oct 25, 2011 3:57 PM
    removed a ;

  • Calling Functions From Import Integration Script

    I've got an import integration script that runs fine, however I also have several DataPump scripts that are used in FDM to change specific columns as they come in. I can take the code from the scripts and add to the Import Integration script, but I would rather just call those other functions from the VBScript. I don't see any docs on this, and I'm just wondering if anyone has done this or can describe how I can do it.
    Is it possible? Since the standard import scripts reference the strField and the strRecord, can these functions be called from the import integration script?

    strField and strRecord are arguments passed by the application to the import function. The represent the field as defined by the import format and the record that is being processed during the import.
    Given that, I'm not sure how to answer your question.

  • Calling function from sql folder vs report

    Hi,
    A report based on a custom sql folder is taking a long time to run. One of the things that I noticed is that when I run the sql in plsql it takes a long time, but if I remove the row where I call a function, it runs pretty quickly.
    In general, is there a difference between running a function from the sql custom folder and calling it from the report itself?
    Thanks.
    Leah

    Hi Tamir,
    I might check out the execution plans, but truthfully, understanding the plans and the meaning of the differences is not my strong point.
    I thought that maybe there was some general rule that, for instance, it is better to keep functions out of the sql folder and use them in a condition in the report itself, or the opposite, or that maybe it makes no difference at all.
    I appreciate the response.
    Thanks.
    Leah

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • Put SQL query in a function/ call function from region

    How can I write a SQL query (like SELECT EMPNO, ENAME, JOB FROM EMP) as PL/SQL function, and then call this function from the PL/SQL Function Returning SQL Statement region?
    Thanks, Tom

    thanks jverd for your quick reply.
    I know passing in a reference to an object will do the job if I want to change the value several parameters in one function call.
    But I want to ask, is there any other ways?
    the following code works.....
    public class TestParameter {
         public static void main(String[] args) {
              Test2 t2 = new Test2();
              invokeChange(t2);
              System.out.println("x = " + t2.x + "\t y = " + t2.y);
         static void invokeChange(Test2 t2) {
              t2.x = 10;
              t2.y = 15;          
    class Test2 {     
         int x;
         int y;     
    }

  • Getting session hang When calling Function from SQL query

    Hi All,
    I am using Oracle 8.1.7.4.0. I have a fucntion in a Package and I am calling it from the SQL query. When I am firing the query my oracle session is going to hang position and I am not able to any thing. I have to kill the session.
    But this same thing is working fine in Oracle 9.i.
    There are no out parameter and no DML, DDL and DCL statement in this fucntion.
    Could you please get back me what is the problem on it.
    Regards
    SUN

    Check why your session hangs.
    Just a few ideas:
    * Blocking locks?
    * Endless loop?
    * Performance (maybe it is just slow in orac8i and you have to wait a bit longer). Check the execution plans of the SQL statements in your function.
    * Don't use a function, but direct SQL, it is faster in both versions.

Maybe you are looking for