OnClick event for a button

hi! i did up a form using the wizard and added an extra button besides the usual update,reset etc.
i need the onClick event of the extra button to call up a pl/sql procedure, pass in a parameter and ideally open up the report/chart in a new window and without the toolbars etc.
i tried the following:
phang.aresulttally?qid_p='QUESTION_RESULT.MASTER_BLOCK.QID.01.value'
where QUESTION_RESULT.MASTER_BLOCK.QID.01.value is a text box value from the form.
It gives me some scripting error when i run the form.
but if i use the following:
phang.aresulttally?qid_p=2
it works and opens in a new window?!
pls advise.
thx

For the onClick javascript event of the new button, call your own javascript function as:-
myFunc(this);return;
Then, you need to generate this javascript function using pl/sql in the Additional pl/sql Section - ... before displaying the page or ... after displaying the page.
The code to get the value of a field and to open a new window would look something like :-
htp.p('
<script>
function myFunc(ele)
var l_form = ele.form;
var win;
var val;
var l_url = "<url>?";
for (var i = 0; i < l_form.length ; i++){
if (l_form.elements.name == "QUESTION_RESULT.MASTER_BLOCK.QID.01"){
val = l_form.elements[i].value;
l_url = l_url+val;
win=window.open(l_url);
</script>

Similar Messages

  • Writting Events for TableView Buttons

    Hi SDN,
    I created a table view in a jsp dynpage which has one of the columns type as button.i got it by using "setColumnType" attribute of tableview.
    now i want to fire server and client events onclick of those buttons.how to achieve it? can we write client and server events for those buttons as like normal buttons.
    if yes tell me how and where to write?
    explain me with example (coding) if possible.
    Thanks & Regards,
    Art.
    /points will be rewarded/

    Hi Subathra,
    Thank you for ur reply.i know that we can achieve it using "setOnCellClick " but i want to know whether we can use the normal attributes of a button for this button placed in a cell of a tableview.
    if yes how to use it.is there any relation between cell renderer attribute and my requirement.
    <b><u>Note:</u></b>
    you can share ur ideas about other components also which can be used in a tableview (inputfield,link,image...) and writting events for those components.
    Thanks & Regards,
    Art

  • Contextual Event for a Button in Dialogue (inline popup)

    I have dialogue(in-line popup window) which opens on click of button "viewPopUp" in parent window.
    I have a table and "select" button inside dialogue. I have contextual event created for this button inside child wondow.
    It never works for me. Its not calling the event handler method. But, If I add a contextual event for the button "viewPopUp" on the parent page works fine.
    Anybody faced similar issue?
    Any idea or tips to get it work?
    Edited by: sideeque on Sep 17, 2011 11:08 PM
    Edited by: sideeque on Sep 17, 2011 11:09 PM

    I use JDeveloper 11.1.1.5. I might be doing something wrong here. Do you have the sample code to share and test in JDeveloper 11.1.1.5? Is it running for you in JDeveloper 11.1.1.5 version?

  • How the PCUI event for export button works?

    Hi All,
    After get the order search result in PCUI, when I click the Export button.
    It show me the message that : Microsoft office 2003 or higher is not installed on your computer.
    In fact, I have the office 2003. And I found that the event for Export button is PCF_DL_EXPORT.

    Have you tried double-clicking on the auto complete component in the designer? You should be taken to a method like "autocomplete1_complete". This method is called when the autocomplete gets focus and also for each character typed in the field.
    Cheers!
    -David

  • How to add a new button in IC tool bar and handle the event for the button?

    Hi,
        I am working on CRM 2007 Interaction center. To add a new button to IC toolbar, customizing is available to define a new button and then assign in to the profile.
    In SPRO->CRM->IC webclient->Customer Specifc System Modifications->Define Toolbar Buttons, I defined one new button with ID ZSTART.
    Now in SPRO->CRM->IC webclient->Basic Functions->Communication Channels->Define Toolbar Profiles , I selected Default profileid and in Generic Layout Buttons Tab, I added the new button ZSTART in Position 3.
         So after completing the customizing when the user logs in using role IC_AGENT,  the button (with ID:ZSTART) gets displayed in the IC toolbar too.
          Now on click of this button, I need to create an object.
    To do so, I have to catch the event which is raised by this new button.
           Please let me how to implement the event handler for this new button. What will be the event name for this button click event and how I can subscribe for it ?
         Please let me know if anyone of you have already worked on similar requirements.
    Regards,
    Manas.
    Edited by: manas sahoo on Jul 22, 2008 7:49 PM

    Hello Manas,
    There are a couple of threads in the community that might help you out (if you haven't already found them):
    Re: IC Web Client Toolbar
    /message/3621917#3621917 [original link is broken]
    Regards,
    Renee Wilhelm
    Edited by: Renee Wilhelm on Nov 6, 2008 7:46 PM

  • Event for a Button

    Hi, Im principiant and i need to asign a event to a Button.
    I want when i clicke de button the text in a etiquete go to an area panel.
    Somebody can help me?
    Thanks

    something like the following.
    TextArea area = new TextArea();
    Button myButton = new Button("click me");
    myButton.addActionListener(this);
    public void actionPerformed(ActioneEvent E){
    area.setText("text to be displayed");
    }

  • Javascript Onclick event on INSERT button - Kind of urgent

    I PUT THE FOLLOWING CODE ON THE JAVASCRIPT EVENT "Onclick" FOR THE INSERT BUTTON.
    onClick:
    var x=window.confirm('Are you sure ?')
    if (x)
    do_event(this.form,this.name,1,'ON_CLICK','');
    else
    return false
    IF I CLICK "OK", THEN THE FORM VALIDATION FIELDS JAVASCRIPTS STARTS TO COME UP (like NULL fields, etc...) AND ALSO THE INSERT PL/SQL CODE IS STARTED.
    THEREFORE, I RECEIVED THE ERRORS FROM THE JAVASCRIPT VALIDATION FORMS BUT I ALSO RECEIVE THE ORACLE DATABASE INSERT ERROR .
    WHY IS THE PROGRAM EXECUTING THE PL/SQL INSERT EVENT HANDLER IF I HAVE PRIOR ERRORS ?
    I AM DOING SOMETHING WRONG?
    ANY HELP WILL BE MUCH APPRECIATED..
    TKS!

    Hi,
    I think that your Javascript code is calling the do-event code for the form, where all that you need to do is stop if there is a problem, as the event has already started and the form validation will run if your onclick code returns true.
    if (window.confirm("Are you sure?")) return true;
    else return false;
    Regards Michael

  • How to Handle Events for JOptionPane buttons?

    Hi All,
    I need a help...
    I am trying to develop a simple SWING application that consists of multiple elements (mainly text fields) and a Submit button. On pressing Submit button, it should validate all the fields and then do something else. But if some fields are left blank, then it should give a pop-up message and on clicking the OK button on the pop-up message, the focus should go to that text field which is left null.
    The problem is I am not able to understand how to Capture this OK button click-event of the pop-up message. I mean how to do something when the OK/Cancle button of the pop-up window is clicked.
    Please Help me.
    Thanks in Advance,
    Ujjal

    As already pointed out, JOptionPane has some static methods which show a dialog, and return an int, or a string. The whole point of this class is to remove the need for any event handling by the developer, that is, you simply call the showDialog method or whatever, and it returns a value telling you, for example, which button was pressed - no need for action listeners at all. The result of the showDialog method (or whichever you use) tells you which button was pressed. Check the javadocs for JOptionPane for details of several constants that indicate which button was pressed
    The class exists to make simple dialogs trivial to generate - you're overcomplicating things!

  • Triggering PAI event for Radio button

    Hi Experts,
      In module pool programming, I create 2 radio buttons, namely fileins and tableins, and they have been grouped. But while running, change of radio button doesn't trigger PAI event. Is there any possiblity to trigger PAI without ENTER key pressing.
    Thanks and regards,
    Venkat

    Hi
    U need to assign an ok_code to the radiobutton, in this way it'll be like a pushbutton and the pai will be triggerd as soon as it'll press it.
    Max

  • Can a program a double click event for a button in Flash Catalyst?

    I currently have a button programed in FC with a single click. I would like the exact same behavior to happen whether there is a single or double click on the same button.
    Is there a way to do this in FC? If not can I pull it into another program to edit the code?
    Thank you!
    Sarah

    Thanks for letting me know.
    Unfortunatly it looks like I can't upgrade unless I upgrade my whole suite, which is a bummer. We just spent a small fortune on upgrading everyone from CS3 - SC5. I will have to check with our account rep, but I doubt I can get another software update approved this year. Maybe next.
    Thanks again Chirs!

  • Event for browse button for fileupload control

    I'm creating an application, where I need to check which file is choosen for the file-upload. Depending on the file upload, 2 other fields will be filled in because the filename is concerning a certain standard.
    Can I do this with javascript for example without needing to post my page.
    Any help would be most welcome

    You can do this with javascript.
    var fileName = document.getElementById('fileUploadComponentId').value;
    if (fileName.substring(fileName.indexOf('.' + 1)) == 'ext') {
        // the extension is "ext".
    } else {
        // the extension is not "ext".
    }

  • Unable to capture onClick event of htmlb:image in a controller

    Hi,
    I am trying to capture onClick event of an htmlb:image (which is present in my view) in DO_HANDLE_EVENT method of my controller.
    Surprisingly, when I click the image, page does refreshes. But the event in not captured in do_handle_event method. Control never reaches that method. Whereas if I put onClick event of a button, it is easily captured in do_handle_event method.
    Ex. code in my view is:
    <%@page language="abap"%>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="htmlb" prefix="htmlb"%>
        <htmlb:image id      = "searchimg"
                     src     = "consvalue.jpg"
                     onClick = "search"  />
        <htmlb:button id="searchbutton" onClick="search"
                                     text="Event Test"/>
    Now, the button event is captured, but not the image event.
    Any idea why this might be happening?
    Regards,
    Kaushal

    Hi Kaushal,
    are image and button enclosed by <htmlb:form> ?
    Please post your of do_handle_event, where you look for the event.
    Regards,
    Sebastian

  • Input Field in table - I need a OnClick Event

    Hello everybody,
    I have the following problem:
    I have created a table in my view which is filled at runtime. The table has 3 different rows and every row has TableSingleMarkableCells, these cells further have a input field as their celleditor.
    I now want to know which cell the user is editing. I have a AttributePointer through which I know that at the time the user presses the enter key. But I need to know whether the focus has changed. Because there is the possibility that the user switches between the differnt cells with the arrow key or the tab key. But the AttributePointer only gives me the first selected cell.
    Have anybody a suggestion to solve this problem -  it seemed to be something like definingb a OnClick event for a input field (additionaly to the default OnEnter event...)
    Best regards,
    Sebastian

    Hi,
    You can find out at which row the editing goes, by using
    onLeadSelect action of TableUIElement.
    in onLeadSelect action you can find row number using this statement
    int rownumber= wdContext.node<TableNode>().getLeadSelection();
    Regards
    LakshmiNarayana

  • Htmlb:button  onClick event

    Hi experts I'm using follwoing code  for htmlb :button
              <htmlb:button       id            = "myButton2"
                                text          = "<%= v_save %>"
                               tooltip       = "<%= v_save %>"
                               onClick       = "approveClick"
                               design        = "emphasized"
           />
    and in
    do_handle_event  I'm using followin code
    DATA : button_event TYPE REF TO cl_htmlb_event_button,
             event1 TYPE REF TO cl_htmlb_event.
      event1 = cl_htmlb_manager=>get_event(  runtime->server->request ).
      CASE event1->server_event.
        WHEN 'approveClick'.
          button_event  ?= event1 .
    <   some code >
    ENDCASE.
    when i clicked the button it is not going into do_handle_event
    I'm unable to capture onclick event of button .I tried it by keeping some break points .But couldn't be ableto capture it
    Here I'm using MVC pattern .When one check box clicked in view of another controller  the page which contains this button will be displayed.Do i need to write any additional code for it

    There are 2 kind of break-points.
    1. Session break-points - This will wok only to debug normal ABAP codes.
    2. External break-points - This will help you to debug BSP/Webdynpro application.
    Set the external-break point to figure out whether its triggering the events or not.
    <b>
    To set the external Break-points:</b>
    Before settings the external-break-point, you need to Active External break-point for HTTP. YOu can find this option in
    SE80, in
    Utilites--> Break-point/External break-point or Utilites--> External break-point --> Set External break-point
    or if you dont find, then
    utilities-->setttings -> ABAP Workbench -> look at the debugger tab
    & find the external Debugging check box or External Debugging user ID. Give SAP User ID
    Also have a look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/00ab3b72d5df3be10000000a11402f/frameset.htm
    <i>* Reward each useful answer</i>
    Raja T
    Message was edited by:
            Raja Thangamani

  • Event Handling for HTMLB Buttons

    Dear Pros,
    How we handle HTMLB Button Events for the following Code in the Layout section:
    I want the user to Click this button for Downloading the Internal table displayed onto an Excel file on Presentation Server.
    <htmlb:content design="classic" >
      <htmlb:page title="page1 " >
        <htmlb:form>
          <htmlb:button id = "Dwd_Excl"
             text          = "Download to Excel"
             tooltip       = "Please click for Excel Download"
             onClientClick = "EXCEL"
             design        = "small"
             width         = "200" />
          <htmlb:tableView id          = "tv1"
                       headerText      = "Sales Statement"
                       design          = "alternating"
                       headerVisible   = "true"
                       visibleRowCount = "20"
                       selectionMode   = "lineEdit"
                       table           = "<%= t_zsstable %>"
                       iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    Waiting for your suggestions/replies.
    Sincere Thanks to All.
    Vivek Singh.

    Hi Craig,
    Just worked on the code sample you provided. Heres' how my code looks in OnInputProcessing segment:
          Some internal table population code here
    then the following code segment:
    file = 'C:\ZSS.XLS'.
    event = cl_htmlb_manager=>get_event_ex( request ).
    IF event IS NOT INITIAL AND event->event_id = 'Dwd_Excl'.
      results = 'Button was pushed'.
    ENDIF.
    IF results = 'Button was pushed'.
      CALL FUNCTION 'WS_EXCEL'
        EXPORTING
          filename      = file
        TABLES
          data          = t_zsstabl
        EXCEPTIONS
          unknown_error = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    The problem is that when I push the Download to Excel HTMLB Button, the following Error is being displayed on the page :
    500 SAP Internal Server Error
    Error message: Exception condition "NO_BATCH" raised. ( type of termination: RABAX_STATE )
    The Layout part code is :
    <htmlb:content design="classic" >
      <htmlb:page title="page1 " >
        <htmlb:form>
          <htmlb:button id            = "Dwd_Excl"
                        text          = "Download to Excel"
                        tooltip       = "Please click for Excel Download"
                        onClick       = "ExcelButton"
                        design        = "small"
                        width         = "200" />
          <htmlb:tableView id              = "tv1"
                           headerText      = "Sales Statement"
                           design          = "alternating"
                           headerVisible   = "true"
                           visibleRowCount = "20"
                           selectionMode   = "lineEdit"
                           table           = "<%= t_zsstabl %>"
                           iterator        = "<%= iterator %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    I hope you can suggest something on this.
    Waiting for your response.
    Best Regards,
    Vivek.

Maybe you are looking for