ADF event handler

Hello,
I am using s simple ADF Drag&Drop-Editing form
(and added a "delete-action"-button)
My problem:
In the database there is a look up table containing only one column per row,
and this column also is the primary key (= not null). If the value of the column
is "-" in the application, then the user is not allowed to delete this value/row
(from the [lookup] table).
How to do this? [cancelling the delete-button action?]

repost

Similar Messages

  • Event handling in LOV

    Hi There,
    We have a use-case where we need intercept the event of af:inputComboboxListOfValues component.
    I have table, which has three columns, Name, Description and Label.
    I have a LOV on Name column.
    When user change the value of Name column by selecting an value from dropdown, I need to do business validation, I show user the "Yes/No" popup with warning message, and base on the user's choice, either proceed with the change or stop the change.
    My problem is that I am unable to find a appropriate event to show the popup.
    I know there are several events in the af:inputComboboxListOfValues component, launchPopupEvent, returnPopupEvent and valueChangeEvent.
    1. If I show popup on launchPopupEvent, after the user click "Yes/No" button on the popup, the page will be refreshed and dropdwon doesn't show the item list.
    2. returnPopupEvent and valueChangeEvent event will be handled by framework in one request, there is no chance for user's interaction.
    I am not familiar with ADF event handling machenism, can anyone help me?
    Thanks in advance.
    Thunder
    Edited by: 984466 on 2013-3-7 下午4:59
    Edited by: 984466 on 2013-3-8 上午12:51

    Hi,
    first of all, never post questions regarding internal JDeveloper builds (11.1.1.7 is not released to public) on this public forum. You are from Oracle and therefore have internal channels for this (note that using internal builds the problem could be with the build and not necessarily the code alone).
    To your question:
    I don't understand why
    +"2. returnPopupEvent and valueChangeEvent event will be handled by framework in one request, there is no chance for user's interaction."+
    doesn't work. If you set the "name" column component to autosubmit="true" then the listener fires as soon as you move out of the field and you can raise the alert. The current row in the binding points to the row you changed the name for and as such the value can be unset (the value change listener shows you the before and after value)
    Frank

  • How to set event handler in af:inputText  adf faces component.

    Hi,
    I am using ADF Faces components for my application.
    I want to capture the onchange event of a text box on the server side.For this what should I do. How do I register an event handler for this.
    In the documentation of the CoreTags of the ADF for onFocus it is stated as below.Will this help me in any manner ?
    onfocus String the event handler for when the element receives focus.
    Please help me.
    Regards
    Uma

    Uma,
    - set autosubmit to true
    - set a value change listener in the managed bean
    Frank

  • SelectManyCheckbox event handling

    Hi,
    I am new to this ADF technologies. In my jsp i have a selectmanycheckbox component and have a event handler method in backingbean, when i am clicking on the checkbox the control is going to
    event handler method in backing bean, its fine and working..
    My question is where the control is going or which method is invoking when i am unchecking the same check box ,its not coming to same event handler
    Any help is appreciated...
    Thanks in advance..
    Anoop C

    my jsp code
    <af:selectOneChoice onchange="return fnCheck()"           id="financialYearId" binding="#{acctSummaryBB.financialYears}"
         valueChangeListener="#{acctSummaryBB.getSelectedFinancialYear}"      autoSubmit="true" >
         <f:selectItems binding="#{acctSummaryBB.financialYear}" />
    </af:selectOneChoice>
         <af:selectManyCheckbox id="BU" onclick="selectAllBU()" immediate="true" valuePassThru="true" autoSubmit="true"
    value="#{acctSummaryBB.selectedBUs}" valueChangeListener="#{acctSummaryBB.triggerBU}" >
                   <f:selectItem itemValue="ALL" itemLabel="ALL" />
                   <f:selectItems value="#{acctSummaryBB.allBU}" />
         </af:selectManyCheckbox>
    My BackingBean Code
    public void triggerBU(ValueChangeEvent evt)
    int FY = 0;
    String str = "";
    if (evt != null)
    FacesMessage fm;
    System.out.println("##################### BU CHANGE START####################");
    selectedBUs = ((List)evt.getNewValue());
    System.out.println("##################### SELECTED BU===" + selectedBUs);
    public void getSelectedFinancialYear(ValueChangeEvent event)
    System.out.println("############### START OF FIN YEAR CHANGE METHOD ##################### ");
    Every time control is going to getSelectedFinancialYear() after invoking triggerBU() method when i am checking one item from the SelectManyCheckBox.
    Can anybody provide a solution for this...How can i stop firing ValueChangeEvent from selectOneChoice .
    Plz..Provide a solution.....Thanks..

  • Action Event Handler on Tree nodes

    I have an actionListener event handler registered on a tree node as follows:
    <af:tree value="#{bindings.SomeViewObj1.treeModel}" var="node" rowSelection="none" id="t1"
    binding="#{EditFormBean.tree1}" displayRow="selected" summary="Tree"
    partialTriggers=":::cb1 :::cb2">
    <f:facet name="nodeStamp">
    <af:panelGroupLayout id="pgl3">
    <af:outputText value="#{node}" id="ot1"/>
    <af:commandImageLink text="E" id="cil3" partialSubmit="true"
    *actionListener="#{EditFormBean.onEdit}"* binding="#{EditFormBean.cmdImageLink}">
    <af:setPropertyListener from="#{node.hiertType.structureDefName}" type="action"
    to="#{viewScope.formView}"/>
    <f:attribute name="node" value="#{node}"/>
    </af:commandImageLink>
    <af:commandImageLink text="A" id="cil1"/>
    <af:commandImageLink text="D" id="cil2"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    I have at each node stamp facet a panelGroup Layout that contains the node value and a command Image link. The tree has two hierarchical levels. When I press the command Image link on the first tree noe level, the actioListener method in teh managed bean (EditFormBean.onEdit) gets called. When I press the same commandImage link on the second tree level, the same action listener does not get called. I need to get past this problem before I code the actionListener which needs to set the current row in the iterator based on the key selected on the tree node. I simply have a print statement in the action listener method which shows something when the first level command image link is clicked but does not print anything when the second level command image link is clicked.
    I am using JDeveloper 11.1.2.1.0
    There is also adf faces code around this snippet that uses an af:switcher facea component to display the appropriate form based on the nodee level in which the comman d image link is clicled but it is irrelevant to the problem I am getting.
    Any help on that would be appreciated

    Hi,
    hard to say . Didn't see this before. Can yoiu remove "binding="#{EditFormBean.cmdImageLink}"" from the command link. The tree stamps its children so that it doesn't make sense to keep a handle to the component instance
    Frank

  • Override lifecycle event-handler in 11g

    Hello,
    I am trying to override lifecycle event-handling in 11g environment with the standard ADFPhaseListener.
    In faces-config.xml I registered:
    <lifecycle>
    <phase-listener>oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener</phase-listener>
    </lifecycle>
    I have a backing-bean that extends oracle.adf.controller.v2.lifecycle.PageController
    and override some methods like
    @Override
    public void prepareModel(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.prepareModel(lifecycleContext);
    @Override
    public void prepareRender(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.prepareRender(lifecycleContext);
    @Override
    public void processComponentEvents(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.processComponentEvents(lifecycleContext);
    @Override
    public void processUpdateModel(LifecycleContext lifecycleContext) {
    int x = 1;     // Dummy Statement
    super.processUpdateModel(lifecycleContext);
    If I set breakpoints in all 4 methods however they are never matched, not when entering the page nor during roundtrips.
    Is there anything else I have to do to make it work. I couldn't find a detailed example for 11g.
    Bruno

    Hello,
    and thanks for your help.
    Meanwhile I created a Custom PagePhaseListener with PhaseListener Interface and registered it on the JSPX <f:phaseListener binding="..."/>
    This matches my requirements even better since I need a listener for only one JSPX.
    Since this is a JSF (not ADF) Interface I only get the Standard Lifecycle-Phases, which are fewer than in Frank's example, but they are sufficient for my purposes.
    Or do you see any other major drawbacks.
    Bruno

  • STRUTS and UIX: How to use getCustomMethod in event handler

    I am having app module method exposed to a client as my custom method that does something. Then I have a data page (UIX) with a submit button that triggers event handler:
    public void onMyEvent(DataActionContext ctx) {
        HttpServletRequest request = ctx.getHttpServletRequest();
        HttpSession session = request.getSession();
        JUCtrlActionBinding method = ctx.getCustomMethod();
        if (method == null) System.out.println("method is null!!!!!!!!!!!");for some reason my method handle is null WHY???
    this seems to work when I call my method from findForward() though.

    If you use ADF BC, you can override the method create(AttributeList) in the Entity Object implementation class (EmployeesImpl.java).
    Use: Menu --> Tools --> Override Methods --> create
    In the overridden create method you can assign the next value from a DB sequence (e.g. EMP_SEQ) to the ID attribute:
    protected void create(AttributeList nameValuePair) {
    // Super
    super.create(nameValuePair);
    // Id
    SequenceImpl s = new SequenceImpl("EMP_SEQ", getDBTransaction());
    setEmployeeId(s.getSequenceNumber());
    }

  • Capturing the Cancel button with Before Print event handler

    I put together a script that is triggered by a beforePrint event handler. Everything works fine but I can't figure out how and where to capture the user clicking on the Cancel button in the Print dialog?
    Any ideas? Thanks, Dan

    Alen,
    My bet is you are using JDeveloper 11.1.1.5. This is a known ADF bug 12551764 in this release, not related to JHeadstart.
    Here are the details:
    http://adfbugs.blogspot.com/2011/05/jdeveloper-11115-serius-bug.html
    I just checked the bug database, it is fixed in patch 12399372. You can go to metalink to download the patch.
    Steven Davelaar,
    JHeadstart Team.

  • JDEV 10.1.2 UIX Tree Event Handler

    Hi,
    I have built my tree bound to two ADF entities/views.
    It works fine in a small standalone application, but as soon as I try to integrate it with my main app it fails to call either the "null" or the "expand" event handler (null for page rendering and expand for... well expanding the node (see below))
    I've run it in debug and the event code just isn't getting fired
    There must be something in my main app that is intercepting the event handler before it gets to my uix handlers.
    New to all this so any help greatly appreciated!
    In summary, what would intercept default event handling in a uix page.
    Thanks
    Mark
    <handlers>
    <event name="expand">
    <method class="view.TreeUtils" method="doTreeEvent"/>
    </event>
    <event name="null">
    <method class="view.TreeUtils" method="doTreeEvent"/>
    </event>
    </handlers>

    Hi,
    it appears that if I change the forward to have 'redirect="true"' within the struts config file then this works fine now.
    Mark

  • UIX event handler + struts

    Hi,
    I'm using UIX + struts in jdev10g and im getting problems trying to handle a simple action binding event like the "Next" operation. Below is a short example of what im trying to do.
    Test.uix
    <submitButton text="Next" model="${bindings.Next}" id="Next2" event="next"/>
    <event name="next" source="Next2">
    <invoke method="doIt" javaType="oracle.jbo.uicli.binding.JUCtrlActionBinding"
    instance="${bindings.Next}"/>
    </event>
    testAction.java
    public void onNext(DataActionContext ctx)
    if (ctx.getEventActionBinding() != null)
    ctx.getEventActionBinding().doIt();
    If i run the code above i can see that it executes ctx.getEventActionBinding().doIt(); but the action binding never gets executed, and this efect is the same for other actions like create,previous etc...
    Another thing that calls my attention is that every time i drag a operation from the DataControl Palette the event name is always "action"
    <submitButton text="First" model="${bindings.First}"
    id="First0" event="action"/>
    So how is the correct way to handle events in the UIX + Struts?????
    Please i need a help on this one!!!!!
    Tanks,
    Eduardo M. Sasso

    First of all tanks for the help.
    But what i want to do is to subclass the DataForwardAction for my DataPage and let the struts controller handle the event, just like the documentation says...
    About Event Handling in Applications Using Oracle ADF, UIX, and Struts
    http://helponline.oracle.com/jdeveloper/help?topic=adf_auixadfevents_html
    If i try to do the same thing using jsp it works great...
    This is problem is getting me nuts!!! it looks to me that this problem is very easy to solve but i just cant see the solution....
    tanks again

  • How to add an event handler dinamically

    Hi all
    I ceated Rich Adf component dinamically
    RichShowDetailItem pnl = new RichShowDetailItem();
    pnlTabbed.getChildren().add(pnl);
    pnl.addDisclosureListener(??????);
    i have a method in my bean
    public void showDetailItem_disclosureListener(DisclosureEvent disclosureEvent) {
    how to add event handler for this component to call this method?
    Thanks in Advance
    Soso

    Hi,
    see: http://thepeninsulasedge.com/frank_nimphius/2008/02/01/adf-faces-rc-how-to-programmatically-add-an-event-listener-to-a-dynamically-created-component/
    Frank

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • Copying text to the clipboard in AVDocDidOpen event handler causes Acrobat 9 to crash

    I'm trying to copy the filename of a document to the clipboard in a plugin with my AVDocDidOpen event handler.  It works for the first file opened; however when a second file is opened, Acrobat crashes.  The description in the application event log is: "Faulting application acrobat.exe, version 9.1.0.163, faulting module gdi32.dll, version 5.1.2600.5698, fault address 0x000074cc."
    I've confirmed that the specific WIN32 function that causes this to happen is SetClipboardData(CF_TEXT, hText);  When that line is commented out and remaining code is left unchanged, Adobe doesn't crash.
    Is there an SDK function that I should be using instead of WIN32's SetClipboardData()?  Alternately, are there other SDK functions that I need to call be before or after I call SetClipboardData()
    Bill Erickson

    Leonard,
    I tried it with both "DURING, HANDLER, END_HANDLER" and "try catch," as shown below.  However, it doesn't crash in the event handler; it crashes later, so the HANDLER/catch block is never hit.
    The string that's passed to SetClipboardData() is good, because I'm able to paste it into the filename text box of the print dialog when I try to create the "connector line" PDF.  I also got rid of all the string manipulation and tried to pass a zero-length string to the clipboard but it still crashes.
    Here's the code:
    ACCB1 void ACCB2 CFkDisposition::myAVDocDidOpenCallback(AVDoc doc, Int32 error, void *clientData)
        PDDoc pdDoc = AVDocGetPDDoc(doc);
        char* pURL = ASFileGetURL(PDDocGetFile(annotDataRec->thePDDoc));
        if (pURL)    {
            if (strstr(pURL, "file://") && strstr(pURL, "Reviewed.pdf")) {
                // Opened from file system so copy filename to clipboard for connector line report
                char myURL[1000];
                strcpy(myURL, pURL);
                ASfree(pURL);    // Do this before we allocate a Windows handle just in case Windows messes with this pointer
                pURL = NULL;
                HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE, 1000);
                if (hText)    {
                    try
                        // Skip path info and go right to filename
                        char *pText = (char *)GlobalLock(hText);
                        char *pWork = strrchr(myURL,'/');
                        if (pWork)    {
                            strcpy(pText, pWork+1);
                        } else {
                            strcpy(pText, myURL);
                        char *pEnd = pText + strlen(pText);    // Get null terminator address
                        // Replace "%20" in filename with " "
                        pWork = strstr(pText, "%20");
                        while (pWork)    {
                            *pWork = ' ';
                            memmove(pWork+1, pWork+3, (pEnd - (pWork+2)));
                            pWork = strstr(pText, "%20");
                        // Append a new file extension
                        pWork = strstr(pText, ".pdf");
                        *pWork = 0;    // truncate the string before ".pdf"
                        strcat(pWork,".Connectors.pdf");
                        GlobalUnlock(hText);     // Must do this BEFORE SetClipboardData()
                        // Write it to the clipboard
                        OpenClipboard(NULL);
                        EmptyClipboard();
                        SetClipboardData(CF_TEXT, hText);     // Here's the culprit
                        CloseClipboard();
                        GlobalFree(hText);
                    } catch (char * str) {
                        AVAlertNote(str);
            if (pURL)
                ASfree(pURL);

  • Unable to get automatic event handling for OK button.

    Hello,
    I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typing in the edit control and it does not respond to the Enter key hit. Cancel happens when Esc is hit.
    My code looks like this -
    Dim oCreationParams As SAPbouiCOM.FormCreationParams
            oCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            oCreationParams.UniqueID = "MySearchForm"
            oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.AddEx(oCreationParams)
    oForm.Visible = True
    '// set the form properties
            oForm.Title = "Search Form"
            oForm.Left = 300
            oForm.ClientWidth = 500
            oForm.Top = 100
            oForm.ClientHeight = 240
            '// Adding Items to the form
            '// and setting their properties
            '// Adding an Ok button
            '// We get automatic event handling for
            '// the Ok and Cancel Buttons by setting
            '// their UIDs to 1 and 2 respectively
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Search"
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Cancel"
    oItem = oForm.Items.Add("NUM", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 105
            oItem.Width = 140
            oItem.Top = 20
            oItem.Height = 16
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
    What changes do i have to make to get the enter key to work?
    Thanks for your help.
    Regards,
    Sheetal

    Hello Felipe,
    Thanks for pointing me to the correct direction.
    So on refering to the documentation i tried out a few things. But I am still missing something here.
    I made the following changes to my code -
    oForm.AutoManaged = True
    oForm.SupportedModes = 1 ' afm_Ok
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, 1, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
            oButton = oItem.Specific
            oButton.Caption = "OK"
    AND
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.AffectsFormMode = False
    I get the same behaviour OK button changes to update and enter key does not work.
    Could you please tell me find what is it that i am doing wrong?
    Regards,
    Sheetal

  • Dropdown box - which event handler to use ?

    I am having trouble with setting the readonly property (via Javascript) of the adjacent textbox to my dropdown box when the index value is a certain number.
    I tried using MouseUp, MouseDown, and even OnBlur....but the readonly does not seem to be getting set to true or false consistently.
    Could this be a timing issue ? The textbox that I am trying to control is the next tab-order control in the list of controls for this page.
    This same logic is working fine in the MouseUp event handler for check boxes. So I am just wondering if this is a bug or must my implementation change to accomodate dropdown boxes ? For instance, should I move the logic to the Enter event handler of the textbox instead ? Can a control's own eventhandler set itself to readonly when it is the active form field ?

    After tons and tons of testing time, I've come to the conclusion that dropdowns are totally buggy in 11.0.07 release of Acrobat Pro.
    Even if you set the "commit values immediately", you get the PRIOR selected item's value as the event value, not the CURRENT one.
    This occurs in a Validate event handler script. I have not been able to use any other event handlers for a dropdown except the OnBlur....and then, for my purposes, IT'S TOO LATE !!!
    This is totally worthless as I need to setFocus() and set fields to readonly based on the immediate dropdown offset or face value.

Maybe you are looking for

  • Unable to create LOV (Select List)

    As per the dev. guide, I am trying to create a Parameterized Report. When I tried the example given in the guide it works for the sample application. But when I try for my application (based on HR data) it does not work. The steps I am following are

  • How to load data from oracle table to XML using ODI ?

    Hello Team I am trying to load data from an oracle table to an xml file. I have configured the physical and the logical schemas for the same. I have used SQL to SQL as LKM and SQL to SQL Append as IKM with Sunopsis Memory Engine as staging area. Afte

  • Understanding Event-Handling

    I’m trying to understand the Event-Handling in Java. Take for example a button: How does this button -while the program is running- send Events to the Listener ? And how does it know that a Listener exists and “listen” to its Events ? Which method, s

  • Dimension attributes in BPC

    Hi Gurus, Can dimension attributes be used as selection or filtering criteria inside BPC? Thanks in advance, Raffi

  • Can I upgrade to intel i7

    Can I upgrade to intel i7 from core 2? Both chips require the same socket. I have a touchsmart 600XT. Would also like to upgrade to a ss hard drive. Any thoughts?