Custom Button Event Handler

I'm working on a form that inserts data into my database. The normal Insert PL/SQL just does "doInsert". I want to add in the PL/SQL Button Event Handler a condition statement as follows:
IF :new.name_id != null THEN
doInsert;
ELSE
"do something else"
END IF;
"name_id" is one of the form items. I want to check the value in name_id before I insert it into the database. What is the correct verbage in order for this condition to work -- :new.name_id does not work.
Thanks
Susan

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Susan Miller ([email protected]):
I'm working on a form that inserts data into my database. The normal Insert PL/SQL just does "doInsert". I want to add in the PL/SQL Button Event Handler a condition statement as follows:
IF :new.name_id != null THEN
doInsert;
ELSE
"do something else"
END IF;
"name_id" is one of the form items. I want to check the value in name_id before I insert it into the database. What is the correct verbage in order for this condition to work -- :new.name_id does not work.
Thanks
Susan<HR></BLOCKQUOTE>
null

Similar Messages

  • Htp.p doesn't work from the custom button event handler ...

    Hi,
    I am trying to pop up an alert from the custom button event handler. I created a button and put the following code.
    htp.p('<script language='JavaScript1.3">
    alert ("Test Message");
    </script>;
    But alter doesn't show up after clicking the button.
    Thanks

    OK i've attached them and copy/pasted the relevent parts. The parent window is the SFLB file.
    -----------------------------------------here's the code in the parent window
    private function editServerPool():
    void
    serverPoolPUW = PopUpManager.createPopUp(
    this,popups.ServerPoolPopup,true);PopUpManager.centerPopUp(serverPoolPUW
    as IFlexDisplayObject); 
    if (newServerPool.SecondarySPAlgorithm != null){
    serverPoolPUW.enableSSCheckBox.selected =true;serverPoolPUW.DisplaySecondaryServerPool();
    serverPoolPUW.bigResize.play();// serverPoolPUW.height = 602; //yes...i know i need to move thisserverPoolPUW.switchoverPolicyCB.selectedItem = newServerPool.SwitchOverPolicy;
    serverPoolPUW.switchoverThresholdTI.text = newServerPool.SwitchOverThreshold;
    ----------------------here's the code in teh popup window (popups.ServerPoolPopup.mxml)
    <mx:Resize id = "bigResize" heightFrom="506" heightTo="602" target="{this}" /> 
    <mx:Resize id = "littleResize" heightFrom="602" heightTo="506" target="{this}"/>
     public function DisplaySecondaryServerPool():void{
    //make the screen large if the secondary server checkbox is selected; otherwise small.  
    if (enableSSCheckBox.selected){
    //display secondary server pool tab, expand the screen 
    //note that we cannot attach a data provider to the data grid until the grid creation is  
    //completed. This is done in an event handler.secondaryPanel.enabled =
    true; switchoverPolicyCB.visible =
    true;switchoverThresholdTI.visible =
    true;thresholdFI.visible =
    true;policyFI.visible =
    true;bigResize.play();
    else
     <mx:CheckBox label="Enable a Secondary Server Pool" width="264" fontWeight="bold" click="DisplaySecondaryServerPool()" id="
    enableSSCheckBox" fontSize="12" x="83" y="40"/>

  • Is there a C# example of using the ExpressionEdit Control Custom Button Event Handler

    TestStand 4.1
    C# 2008
    I have added the event handler to the ExpressionEdit events as I would any event handler:
    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler(_ExpressionEditEvents_ButtonClickEvent);
    Next, I create the Event Handler using the syntax
    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)
    I get the following error when I try to build:
    Error 1 No overload for '_ExpressionEditEvents_ButtonClickEvent' matches delegate 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler' 
    I assume this means that I don't have the correct parameters or types in my Event Handler declaration but it matches the Object Browser.  Any ideas on what I am missing?
    Solved!
    Go to Solution.

    Try removing the "Ax." from your namespace qualifier as I marked below.  I think you want the one in just the UI namespace.
    Edit: well not necessarily.  Is your exprEdit variable declared as "NationalInstruments.TestStand.Interop.UI.Ax.AxExpressionEdit" or as "NationalInstruments.TestStand.Interop.UI.ExpressionEdit"?
    If it is an AxExpressionEdit then I think you will want your event handler to look like this:
    void exprEdit_ButtonClick(object sender, NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEvent e)
     -Jeff
    skribling wrote:
    TestStand 4.1
    C# 2008
    I have added the event handler to the ExpressionEdit events as I would any event handler:
    exprEdit.ButtonClick += new NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler(_ExpressionEditEvents_ButtonClickEvent);
    Next, I create the Event Handler using the syntax
    public void _ExpressionEditEvents_ButtonClickEvent(NationalInstruments.TestStand.Interop.UI.ExpressionEditButton btn)
    I get the following error when I try to build:
    Error 1 No overload for '_ExpressionEditEvents_ButtonClickEvent' matches delegate 'NationalInstruments.TestStand.Interop.UI.Ax._ExpressionEditEvents_ButtonClickEventHandler' 
    I assume this means that I don't have the correct parameters or types in my Event Handler declaration but it matches the Object Browser.  Any ideas on what I am missing?
    Message Edited by Jeff.A. on 06-11-2010 03:25 PM
    Message Edited by Jeff.A. on 06-11-2010 03:28 PM

  • How to add a custom PL/SQL code for a button event handler

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

  • 'Call' in PL/SQL button event handler

    I have created a form with only one 'Custom' button on it.
    In the PL/SQL button event handler, in 'Custom' event item, I
    inserted some PL/SQL code and, at the end, a call like the
    following:
    my_url:= 'PORTAL30.wwv_component_control.run_as_portlet?'
    || 'p_module_id=' || '2836550185';
    call(my_url,return_url);
    I have a compilation error:
    "PLS-00201: identifier 'CALL' must be declared"
    I also tried to put this code in 'On successful submission of a
    form'. I have no compilation error but it doesn't work.
    Anybody knows hw to solve this problem?
    Thanks.

    Hello Antonnella,
    I have a good tip for you:
    write the next scirp in the 'On successful submission of a
    form'field in the form where you want to call the component:
    declare
    l_url varchar2(2000);
    begin
    l_url := 'the url of the component you want to call' ;
    PORTAL30.wwa_app_module.set_target(l_url,'CALL');
    end;
    you can get the url from:
    develop -> call interface:show -> Example of Call from URL .
    Success,
    Haseeb

  • How to show a message in a form 'PL/SQL Button Event Handler'

    We need validate the sal of an employee, and if it is bigger the value musts
    not be inserted.
    We trying a code like the one shown in the note 134312.1 'HOW TO PASS A
    PARAMETER FROM A PORTAL FORM TO A STORED PROCEDURE' and it works in the insert event of the insert button (using 'PL/SQL Button Event Handler') and it works, but we need to show a message that says the data wasn't inserted. How can we do this?
    The code we used is:
    declare
    v_deptno scott.emp.deptno%type;
    v_empno scott.emp.empno%type;
    v_sal scott.emp.sal%type;
    mySal scott.emp.sal%type;
    v_string varchar2(256);
    blk varchar2(10):='DEFAULT';
    begin
    select sal into mySal from scott.emp where empno=7369;
    v_deptno:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_DEPTNO');
    v_empno:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_EMPNO');
    v_sal:=p_session.get_value_as_number(p_block_name=>blk,
    p_attribute_name=>'A_SAL');
    v_string:='You just inserted empno: '||to_char(v_empno) ||'to deptno ->
    '||to_char(v_deptno);
    if mySal < v_sal then
    doInsert;
    else
    -- We want to display a message here, when mySal > v_sal
    end if;
    end;
    ----------------------------------

    I did something similar but wasn't using a stored procedure. Couldn't you set a flag variable once you know you're not doing the insert and in the "before displaying the form" section put an IF to check if your flag was set, and if so do an HTP.Print('You are overpaid buddy!');
    Then just reset your flag.

  • How to get a form field valud in delete PL/SQL Button Event Handler

    Hi Friend,
    I have a form. when user clicks delete button. we want to remove system dodelete function
    and add a delete script
    Under delete-top category,
    how can I get value of form EVENT_NUMBER field in form at delete PL/SQL Button Event Handler?
    DELETE FROM PTEAPP.PTE_EVENTS WHERE eventnumber = EVENT_number
    But when I try to save this form and get message as
    1721/15 PLS-00201: identifier 'EVENT_NUMBER' must be declared
    Thanks for any help!
    newuser

    I did something similar but wasn't using a stored procedure. Couldn't you set a flag variable once you know you're not doing the insert and in the "before displaying the form" section put an IF to check if your flag was set, and if so do an HTP.Print('You are overpaid buddy!');
    Then just reset your flag.

  • Execute procedure in pl/sql button event handler

    i have a demo application which consists of text boxes
    eg : when i enter department no in first text box and click proc
    it should display dname and loc in the below text boxes.
    my proc is working fine in sql*plus but its showing errors in pl/sql button event handler.
    any ideas
    my proc is create or replace procedure proc1 (no number)
    as
    DNAME1 dept.dname%type;
    LOC1 dept.loc%type;
    begin
    select DNAME,LOC into DNAME1,LOC1 from scott.dept where deptno = no;
    DBMS_OUTPUT.PUT_LINE (DNAME1);
    DBMS_OUTPUT.PUT_LINE (LOC1);
         Exception When No_Data_Found then
    dbms_output.put_line('Entred name is not found');
    When Others then
    Null;
    End;
    /

    Hi,
    you have to use
    htp.p('<SCRIPT LANGUAGE="Javascript1.1">
    document.all("FORMNAME.DEFAULT.ATTRIBUTENAME.01").value="'||DNAME1||'";
    document.all("FORMNAME.DEFAULT.ATTRIBUTENAME.01").value="'||LOC1||'";
    </SCRIPT>
    instead of
    DBMS_OUTPUT.PUT_LINE (DNAME1);
    DBMS_OUTPUT.PUT_LINE (LOC1);
    where formname is your form name and attribute name is the field name on the page.

  • Button Event Handler in a JList, Please help.

    Hi everyone,
    I have created a small Java application which has a JList. The JList uses a custom cell renderer I named SmartCellRenderer. The SmartCellRenderer extends JPanel and implements the ListCellRenderer. I have added two buttons on the right side inside the JPanel of the SmartCellRenderer, since I want to buttons for each list item, and I have added mouse/action listeners for both buttons. However, they don't respond. It seems that the JList property overcomes the buttons underneath it. So the buttons never really get clicked because before that happens the JList item is being selected beforehand. I've tried everything. I've put listeners in the Main class, called Editor, which has the JList and also have listeners in the SmartCellRenderer itself and none of them get invoked.
    I also tried a manual solution. Every time the event handler for the JList was invoked (this is the handler for the JList itself and not the buttons), I sent the mouse event object to the SmartCellRenderer to manually check if the point the click happened was on one of the buttons in order to handle it.
    I used:
    // Inside SmartCellRenderer.java
    // e is the mouse event object being passed from the Editor whenever
    // a JList item is selected or clicked on
    Component comp = this.getComponent (e.getX(), e.getY())
    if(!(comp instanceof JButton)) {
              System.out.println("Recoqnized Event, but not a button click...");
              //return;
    } else {
              System.out.println("Recognized Event, IT IS A MOUSE CLICK, PROCESSING...");
              System.out.println("VALUE: "+comp.toString());
    What I realized is that not only this still doesn't work (it never realizes the component as a JButton) it also throws an exception for the last line saying comp is null. Meaning with the passed x,y position the getComponent() returns a null which happens when the coordinates passed to it are outside the range of the Panel. Which is a whole other problem?
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.
    Can anyone help me with this. Thanks.

    A renderer is not a component, so you can't click on it. A renderer is just used to paint a representation of a component at a certain position in your JList.
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.Thats probably because this is not a common design. The following two designs are more common:
    a) Create a separate panel for your JButtons. Then when you click on the button it would act on each selected row in the JList
    b) Or maybe like windows explorer. Select the items in the list and then use a JPopupMenu to perform the desired functionality.
    I've never tried to add a clickable button to a panel, but this [url http://forum.java.sun.com/thread.jspa?threadID=573721]posting shows one way to add a clickable JButton as a column in a JTable. You might be able to use some of the concepts to add 2 button to the JPanel or maybe you could use a JTable with 3 columns, one for your data and the last two for your buttons.

  • ALV Button event handling

    I have added a custom button on ALV toolbar of my web dynpro view. Now when user click that button, i want to implement the functionality...like onAction...How to do that...where do i need to write the code and how can i capture the button event...
    pls suggest

    Hi ,
    write following to create button:
    DATA: ui_btn1                     TYPE REF TO cl_salv_wd_fe_button.
      DATA: ui_sepa1                    TYPE REF TO cl_salv_wd_fe_separator.
      DATA: sepa1                       TYPE REF TO cl_salv_wd_function.
      DATA: btn1                        TYPE REF TO cl_salv_wd_function.
      data: lr_disp_button type ref to cl_salv_wd_fe_button.
      data: lv_button_text type string.
      CREATE OBJECT ui_btn1.
      CREATE OBJECT ui_sepa1.
      create object lr_disp_button.
    /to create new buttons...
      lv_button_text = 'Refresh Selection'.
      lr_disp_button->set_text( lv_button_text ).
    lr_disp_button->SET_IMAGE_SOURCE( 'ICON_DISPLAY' ).
      btn1 = l_value->if_salv_wd_function_settings~create_function( id = 'LSBUTTON' ).
      btn1->set_editor( lr_disp_button ).
    IN methods tab of view declare:
    ON_REFRESH     Event Handler     On refresh function pf ALV     ON_FUNCTION     INTERFACECONTROLLER     ALV
    in method ON_REFRESH write below code:
      DATA: temp TYPE string.
      temp = r_param->id.
      IF temp = 'LSBUTTON'.
    custom functional;ity
      endif.
    where :
    R_PARAM      Importing     1     IF_SALV_WD_TABLE_FUNCTION     
    This woudl solve ur purpose.
    Regards,
    Vishal.

  • ***How to call BSP App when custom button event fired from toolbar group***

    Dear PCUI Experts,
       I have created one custom button for the transaction CRMD_BUS2000116.
    And my urgnet requirement is , I need to call BSP application which is used to   take data from custom fields and stores into BP table.
    How to call the BSP App. when i clicks on the button.
    Please help me..
    I will reward with great points.
    Regards,
    Stella.

    Hi Purushothaman,
                                 I have created a button in CRRM_ACCOUNT application.
    Now i want to call  a custom bsp application by clicking on that button.I have followed step given in this blog
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1646. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
    But the event is not triggered.Do I have to create an iview for my bsp application?
    How to do that?Plz help.
    Regards,
    Ruby.

  • Button event handler problem

    Hello,
    I need to add an Event handler to a button on my JSP page. The page refreshes very three seconds for other use.
    First, I added the following segment to the page.
    <head>
    <title>Event handler test</title>
    <script type="text/javascript">
    <!--
    function funAdd()
    alert("Your name is already in the list.");
    //-->
    </script>
    <meta http-equiv="refresh" content="3">
    </head>
    <input type = "button" name = "add" value = "Add" onclick="funAdd()" />
    Every time I clicked the Add button, the alert message appeared. It showed the expected result.
    Then, I replaced alert("Your name is already in the list."); with
    <%
    JOptionPane.showMessageDialog(null, "Your name is already in the list.", "Error message", JOptionPane.ERROR_MESSAGE);
    %>
    in funAdd().
    But, the error message showed automatically every three seconds when the page refreshed without clicking the Add button.
    Does any one know the reason, and how to solve the problem?
    Thanks in advance.
    Dan

    You said it yourself, you refresh your page each 3 seconds so each 3 seconds you do a request to your server where you show a messagedialog.

  • Button event handler

    I have a Jbutton ...
    When i click on it.. i want it to open up the chess game in a new window and start playing..
    This is my codes..
    //Event handler for the Jbutton
    if(event.getSource() == Start)
    chess frame=new chess();
    frame.setSize(500,500);
    frame.setVisible(true);
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    However.. when i click on it.. it gives me a java.lang.nullpointerException error...
    the main application codes is actually an applet embedded into a frame...
    Below is the class file which i wanted to link it..If it extends JFrame i can easily link it but it extends java.applet.Applet...
    (public class chess extends java.applet.Applet implements MouseListener, MouseMotionListener,Runnable)
    Is there a way to link it.?

    You may not call JFrame methods on an Applet.
    Also, Applet extends from Panel which is an AWT class, therefore, heavyweight vis&#8211;a&#8211;vis Swing which is lightweight. So you must load it into a Frame. If Chess were extending JApplet you could load it into a JFrame.
        //Event handler for the JButton
        if(event.getSource() == startButton)
            Chess applet = new Chess();
            final Frame f = new Frame();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    f.dispose();
            f.add(applet);
            f.setSize(500,500);
            f.setLocation(200,200);
            applet.init();
            applet.start();
            f.setVisible(true);
        }

  • JTable Custom Cell  Event handling

    Hi,
    I have a column in JTable as image which is rendered by using custom cell renderer. I want to handle action event for the cell...
    I tried adding actionPerformed event for the button using which the image is rendered but the event is not triggered....
    Can you please tell me how to proceed with this
    Thanks,
    S.Anand

    I'm assuming you want to know when the user has clicked on a particular cell in the table. If so, add a MouseListener to the table then implement a MouseListener or one of the Mouse...Adapter classes with the method:
    public void mouseClicked(MouseEvent e)
        Point p = e.getPoint();
        int row = table.rowAtPoint(p);
        int col = table.columnAtPoint(p);
        // now do something according to the cell that was clicked

  • Custom element event handling

    Hi all
    I could not capture event in my custom element. Can anyone explain in detail, a way to capture events of a element defined in the custom element and redirect it.
    Thanks in advance
    Rakesh ;>)

    Hi Rakesh,
       If you are using HTMLB in your layout go through the weblog,
      /people/brian.mckellar/blog/2004/07/28/bsp-programming-handling-htmlb-events
    Regards,
    Azaz Ali.

Maybe you are looking for

  • Macbook pro (early 2008): Trackpad not working under Windows XP

    My Trackpad worked regularly under Windows (Bootcamp) and Mac OSx until some months ago my Motherboard had to be exchanged because of a fault function of the graphics card. When I started Macintosh after the Macbook pro was repaired the Trackpad work

  • No way to get out of App

    Hey guys, Some of my apps won't give me a way to exit the app. The reason is that, for apps like the reader or calendar, when I point towards the top right corner, the x for close doesn't appear. Neither does the last used app when I point towards th

  • LIV Subsequent Debit

    Dear Guru's I have a question regarding LIV and Subsequent Debits. We have a Value Tolerance set of Lower 20% or £50 and upper 2% or £10 (OMR6). I have a Purchase Order for qty 1 Value £1,500. At this point no GR has taken place. In MIRO I create an

  • Is it Normal For MB Looks to Render relative Slow

    Hi , I just Install MB Looks 1.4 on CS5 My System Spec: Win 7 (64bit)  I7-950 , 12GB Ram , Nvidia GTX 570 System 500GB Footage 2X1 TB in Raid 0 Footage Source DV PAL (4:3) PAR(1.094) when apply MB Looks to clip say 3 sec the render time is avrage of

  • Tables & QT

    Hello, I would be more then grateful for any info help and advise. I have created several web pages use Photoshop & Dreamweaver CS4. A graphic then sliced up Photoshop into an html table & images. Once in Dreamweaver, one of the cells has the Adobe P