DataGrid button event problem

Hi All,
How to addEventListerner to DataGrid inside button? And which
event to handle it?I already changed itemRenderer to Button
instance, but I don't know how to add event to it when button
click.
Thanks

Can you try creating a custom component, extending Button. In
the custom component, you can call a function from the custom
component's (Button) click event and throw a event\custom event
from the function. You can then catch the event thrown by the
custom component in the main application and execute the necessary
code.
Hope this helps.

Similar Messages

  • Problems in capturing the button event

    Hi
    I have created a BSP page with some buttons on it.
    I am trying to execute some code on click of the button, I am capturing the button in OnInput processing event using the following code
    event_data = cl_htmlb_manager=>get_event( runtime->server->request ).
    however the event_data is not getting populated with the button event and i am getting a null reference dump...
    can you tell me if i need to anything else apart from adding the above code.
    Thanks
    Bharath Mohan B

    Hi Bharrie,
    the online documentation describes this very clearly. You access it by double-clicking on the BSP Extension element in the Tag Browser.
    A brief snippet from the doco....
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
          DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
          button_event ?= event.
      ENDIF.
    Cheers
    Graham Robbo

  • Uncontrollable mouse button events (single clicks are doubled?)

    Hello, folks--
    I am having a mouse problem that is driving me up the wall. The mouse in question is an optical IM/PS2 mouse--it is a cheap no-name product, but has worked fine for 2 or 3 years. The trouble started maybe six weeks ago when I did a full upgrade. The most important change that I know of in that upgrade was the introduction of HAL, so I strongly suspect that the cause of the problem is related to my HAL configuration, or perhaps a conflict between that and my X config. But anyway, the symptoms I've been seeing include (but are not limited to):
      * Firefox: a single click selects an entire paragraph
      * Thunderbird: a single click in the message list opens the message in a new window
      * Xfwm: a single click on the "windowshade" button collapses the window, then expands it again
        (or vice versa, depending on the initial state)
      * Xfwm: when dragging a window quickly, the mouse "loses its grip"--i.e. the window stops moving even
        though I am still moving the mouse
    None of these things happens every time, but they all happen often. The problems seem most severe in Firefox, but given that similar things happen elsewhere, I would imagine that's due to Firefox's complex event handling exposing a pervasive problem, rather than any kind of application-specific issue.
    With the possible exception of the window-dragging issue, all the above symptoms are consistent with a problem I have seen reported elsewhere, that single clicks are being read as double clicks. However, the only clearly applicable solution I've seen for that issue is to remove all mouse configuration from Xorg.conf, leaving it up to HAL. I tried that and it didn't seem to change anything. However, at the same time I purged the mouse from Xorg.conf, I created an FDI file for the mouse in /etc/hal/fdi/policy. I wonder now if that was necessary--there was no FDI for the mouse before, but perhaps there doesn't really need to be one if you aren't applying any special settings? Dunno, I don't understand much about HAL yet.
    I have tried a couple of other things: first, I set the double click speed to the minimum using the Xfce Mouse Settings applet (BTW, I suppose this applet is a front-end to some shell command or config file, but what?). That seems to help, but only a little. Second, if I use the mouse in an unnaturally precise manner (e.g., when single-clicking, I click as quickly as possible and lift my finger all the way off the button), the problems mostly, but not entirely, disappear.
    Any suggestions?

    mgushee wrote:
    bernarcher wrote:Sounds like faulty hardware.
    Did you try another mouse by chance?
    Well, no, and I suppose to be thorough I should try that. But I am quite sure that the problem appeared suddenly, and exactly at the time of the upgrade I mentioned.
    Well, it could be that your fdi modification tries to catch the mouse events twice in a row. Perhaps you should post the file.
    Besides: There is are no mouse specific fdi settings in my system. I currently have no idea where the mouse behaviour was defined besides my still old xorg.conf. (I did only activate Option "AutoAddDevices".)

  • More event problems

    Hello again, I have yet another event problem. When I try to use this code I get an error saying Abstract class actionPerformed is not implemented in non- abstract class TableWindow. I'm not quit sure how I'm supposed to implement it.

    Here is what I believe to be the relevant code. addWindowListener works but addFocusListener returns the error.
    // Table window
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class TableWindow extends Frame implements ActionListener
    public TableWindow ()
    Create Window
    super ("Test Window");
    setBackground (SystemColor.control);
    setLocation (0, 0);
    setLayout (new GridLayout (5, 5));
    addWindowListener (new WindowAdapter ()
    public void windowClosing (WindowEvent e)
    try
    if (Connected == true)
    // Close the Statement
    stmt.close ();
    // Close the connection
    con.close ();
    catch (SQLException sqle)
    dispose ();
    System.exit (0);
    tPane = new JTabbedPane ();
    tPane.addChangeListener (new ChangeListener ()
    public void stateChanged (ChangeEvent c)
    //Status.setText ("Clicked");
    tablePane = new JPanel ();
    recordPane = new JPanel ();
    recordPane.addFocusListener(new FocusListener()
    public void focusGained(FocusEvent e)
    Status.setText ("Clicked");
    queryPane = new JPanel ();
    TName1 = new TextField (25);
    TName2 = new TextField (25);
    TName3 = new TextField (25);
    idField = new TextField (10);
    idField2 = new TextField (10);
    TitleField = new TextField (25);
    TitleField2 = new TextField (25);
    result = new TextArea ("Under Construction", 5, 30);
    NewT = new Button ("New Table");
    NewR = new Button ("New Record");
    NewQ = new Button ("New Query");
    NewT.addActionListener (this);
    NewR.addActionListener (this);
    NewQ.addActionListener (this);
    TNameLabel1 = new Label ("Enter name of table here");
    TNameLabel2 = new Label ("Enter name of table here");
    TNameLabel3 = new Label ("Enter name of table here");
    idLabel = new Label ("Enter movie ID here");
    TitleLabel = new Label ("Enter title of Movie here");
    TitleLabel2 = new Label ("Enter title of Movie here");
    tablePane.add (TNameLabel1);
    tablePane.add (TName1);
    tablePane.add (NewT);
    recordPane.add (TNameLabel2);
    recordPane.add (TName2);
    recordPane.add (idLabel);
    recordPane.add (idField);
    recordPane.add (TitleLabel);
    recordPane.add (TitleField);
    recordPane.add (NewR);
    //recordPane.add (tableChoice);
    queryPane.add (TNameLabel3);
    queryPane.add (TName3);
    queryPane.add (TitleLabel2);
    queryPane.add (TitleField2);
    queryPane.add (NewQ);
    queryPane.add (result);
    Status = new Label ("");
    // make the window and add components to it
    tPane.addTab ("Table", tablePane);
    tPane.addTab ("Record", recordPane);
    tPane.addTab ("Query", queryPane);
    add (tPane, BorderLayout.CENTER);
    add (Status, BorderLayout.SOUTH);
    pack ();
    setVisible (true);
    public static void main (String args [])
    ConnectToDatabase ("vdds");
    TableWindow tw = new TableWindow ();
    }

  • Tricky Passing Event problem

    Hi,
    I have two files here. 1) MyFavorites 2)
    MyFavoritesItemRenderer
    I have a datagrid with an item renderer. The item renderer is
    essentially a delete image. I am trying to write a function so when
    the user clicks the image, it will remove the row from the
    datagrid. The problem I am having is the item renderer sits in its
    own file and the DataGrid is in another.
    Do I write a private function within the item renderer.mxml
    file that will dispatch an event? I think this is only way to do it
    as I only want my event dispatched when the user explicitly clicks
    the image.
    So in my itemRenderer I suppose I would write a function
    called "deleteRecord()", this function would dispatch an event and
    the file which actually contains the DataGrid would listen for the
    event and act accordingly. Is this right?
    If so, how would I pass a reference to which row I want to
    delete? The itemRenderer sits in its own file and seems to not have
    any knowledge of my <mx:DataGrid>
    My datagrid code is below which shows how I am using my
    itemRenderer
    <mx:DataGrid id="myFavoritesDG" x="0" y="0" width="330"
    height="110" dragEnabled="false" dropEnabled="true" >
    <mx:columns>
    <mx:DataGridColumn width="55" dataField="title"
    headerText="Action"
    itemRenderer="renderers.MyFavoritesItemRenderer" />
    </mx:columns>
    </mx:DataGrid>
    Any help appreciated.
    -Westside

    Your question is a good one and one a lot of people have.
    You are correct in your strategy. Have your itemRenderer use
    dispatchEvent, but when you create the event, set its bubbles
    parameter to true. This will allow the event to climb up the
    component chain. You don't need to have the DataGrid listen for
    this event; you just need to listen for it in the place where you
    want to use it so you can delete the record.
    To get the information you want, make sure your itemRenderer
    implements IDropInListItemRenderer. Classes which implement this
    will have a listData property and that holds the rowIndex. Check
    the documentation for this. If your class doesn't have it,
    implement it yourself, the documentation shows you how to do this.
    Now that you have the information you'll need to dispatch a
    custom event which contains the information. Again, check the docs
    for that.
    Finally, you will need to use ActionScript to listen for the
    event. Let's say the file in which the DataGrid is declared is the
    place where you want to listen for the event. Your custom event
    won't be an event the DataGrid normally dispatches, so you can't
    use MXML to declare the event listener. Instead, do it in
    ActionScript:
    mygrid.addEventListener( "deleteRecord", handleDeleteRecord
    and then declare handleDeleteRecord to have an event
    parameter of the type of your custom event.

  • Handling button events in large app

    I'm currently examining a large swing app, and have observed the following with regard to action events.
    A number of listeners (for buttons, menu items, JLists etc.) are defined at the top of the app. These variously extend MouseAdapter or implement ActionListener, depending on the type of component whose actions they listen for.
    The ButtonListener definition is as follows :
    private class ButtonListener implements ActionListener
    public void actionPerformed(ActionEvent event)
    Object object = event.getSource();
    if (object == button1)
    // button1 actions
    else
    if (object == button2)
    // button2 actions
    .....etc
    One instance of this listener is created in the app, and is used as the actionlistener for each button. This means that the buttonlistener is quite large (as it contains the code for each button in the app).
    Is this the proper way to handle button events for an app with a large number of buttons?

    Thanks for the responses.
    In response to theDude : I agree that defining the action listener for each button can be useful when you can see the button definition and button action in one place; one could counter that by saying that grouping all the button actions makes it easier to examine all button actions in one place.
    Setting the action command isn't really an option because the application creates panels of buttons on the fly, e.g. when notification of a new customer is received, a new panel is created with a JTextPane (customer description) and a row of buttons for "Modify", "Delete" and "Print".
    Several customer panels could be in existence at the same time, so setting an action command of "Modify" would not enable one to uniquely identify which "Modify" button was pressed.
    This problem is currently handled by associating the panel instance with a "Customer" class instance in a hashtable. The "Customer" class consists of a JTextPane field, and a JButton for each function. When a button is pressed, the button listener traverses up the component's parents until it reaches the panel (i.e. it loops until the parent is a key on the hashtable, at which point it can retrieve the Customer instance and check which button was pressed).
    In response to KPSeal : If I understand you, I would define "ApplicationAction" separately from the main app and define extensions of it in the main app for each type of action. Would this add much value over merely defining a method for each type of action in the main app and just calling this method when the relevant button/menu item was pressed/selected?
    There doesn't seem to be a universal approach to event handling, but I thought there might have been one accepted strategy when an app has large numbers of buttons (some created on the fly, ruling out action commands).

  • Few seconds of processing & button events

    Hi,
    i have a 'theory' question -
    some feature of my app has a bit long processing time, about a few seconds, in which there's an activity indicator running.
    this processing should start after the user pressed some "start process" button.
    my question is -
    is it good or bad or neither to do this large processing issue from within the button's event method (the one connected to "TouchUpInside" event for example, or there's a better way to use events to signal other parts of the application to do that processing.
    the reason i ask this is when i do the processing from within the buttons event method, the button is highlighted and than remains highlighted until all the process is done.it seems that the highlight is there until the button's event method finished.
    i hope i explained myself clearly enough.
    thanks a lot.

    nkobik wrote:
    is it good or bad or neither to do this large processing issue from within the button's event method
    The problem in this case isn't which method starts the long process. No matter where you run that task, it's going to freeze the UI until you get it out of the main thread. Running the process in the action method makes the problem more noticeable since the button's state can't change until the process completes, but freezing the UI is never acceptable even if some users don't notice it. I.e. even if the app has nothing useful to do until the long process completes, the controls should still respond normally, if only to pop up an alert asking the user to be patient. Generally the user should also have the opportunity to cancel a long process, which isn't going to be possible with a frozen UI.
    So it looks like you need to bite the bullet and use some kind of concurrent operation. I think the choice will depend in part on your experience and preference. If you're comfortable with threaded programming, starting a helper thread to run the long process might be the easiest for you. However the SDK supports higher level concurrency management, and if you're not familiar with the NSOperation classes you might want to look over the Concurrency Programming Guide.
    Whatever approach you decide on, let us know if you need help with it, and I'm sure someone around here will be able to advise you.
    \- Ray

  • Loading Flash Paper swf causes all other button events to fail

    Hi Everyone,
    I have created a project with Flash which I am using Zinc to publish as a projector for both Macs and Pcs. Now, in this app I am loading a pdf document converted to a Flash Paper swf. The moment I load this swf file into my project, it appears as though all other button events fail. If I remove the code which loads in the flash paper swf, all buttons function as expected.
    Can anyone please help me with a reason / solution for this?
    Any help is greatly appreciated!
    Cheers!

    Did that and there were no errors shown at any point, such as when publishing the .apk file.
    I found a solution. I was under the impression I needed to use touch events for it to work on a tablet, and changing those to normal mouse events solved the problem. Still not sure why it wouldn't work the other way, but for now it works as needed.
    Thanks!

  • On Browsers refresh/ back button event   terminate user session

    I have a problem pls help me to solve this.
    Requirement is :
    I need to catch browser's [b]refresh back button event.
    Actually I need to terminate his session/login
    when user clicks on browser's refresh button
    and send user on Login page something like banking application(e.g. ICICI Bank) when u logged in ICICI bank side in between if u click on browser's refresh it shows message "Your session terminated " something like that.
    So i want same functinality after user click on Refresh terminate his session

    in my page i am inserting new data and updating existing data
    so for inserting data againe page get submitted so for inserrion time alos these onload & Onunload events get fired
    i tried this but still proble is unsolved..
    give some more ways to solve this

  • Event problem on two different panels

    I have an application which has a main JFrame.
    It has two panels north and south
    The one in the south has buttons that listens for events.
    The events are action events. The events on this panel works if I don't include the events for my other panel i.e
    PersonalDataPanel as described below.
    The noth panel uses card layout. Inside this layout has two panels.
    One panel is called PersonalDataPanel.
    Inside PersonalDataPanel are components.
    One is a group of radio buttons that listens for events
    the events are again action events and if one is choosen from the group it is written to a file.
    I have testdriver for this which works.
    My porblem occurs when I include the code for PersonalDataPanel to listen for events and the main JFrame also to listen for events.
    How should I handle this dilemma??

    Why does the JFrame also have to listen for events? If its only button events surely it doesn't need to be involved and could be causing the problem.
    Have you tried using different event handlers for the different panels...?

  • Event problem with JComboBox

    Hi, javamen.
    I ve gotten a little problem when working with Itemlistener interface. My combo has 4 options, in which the first one always appears when the applet starts up. Whenever the user DOESNT change it and submit the applet form, throught a button click, the applet gets a NullPointerException. But, if the user changes the option, i always get it, throught my interface' methods(ItemStateChanged). Of course, i know its because there was no combobox event, just a button event (click). So, how can i deal with this situation, since i need to get the combobox option content.
    Regards, Euclides.

    But, this is the question! I dont know how to initialize the combobox' first option. Help me, please! I am using the addItem method as follow:
    MakeJCombo ( JComboBox ComboObj) {
    ComboObj.addItem ("option1");
    ComboObj.addItem ("option2");
    ComboObj.addItem ("option3");
    then:
    public void itemStateChange(ItemEvent ie) ...
    Object origem = ie.getSource()...
    if (origem == ComboObj) ...

  • '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

  • CellRenderer + DataGrid + rollOverItem Event

    Hello all,
    I have a custom cellRenderer with a custom button in it. I
    would like to trigger the DataGrid rollOverItem event when the user
    rolls over the button. I haven't been able to find anyting on this
    topic, nor have I been able to figure out a way to use the
    DispatchManager to achieve this.
    Has anyone dealt with this before, or have a method for
    solving this?
    Thanks to anyone with input.
    Jim

    Have you seen the CheckBox CellRenderer example here:?
    http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
    Aren't they triggering DataGrid events when the user selects
    one of the checkboxes?
    I didn't look at it in depth, but if you haven't downloaded
    the .AS file check it out (no pun intended), I think it would lead
    you to the answer.
    Otherwise, try starting out by invoking a custom function
    defined on _root, just as a test to "get out" of the button, then
    work your way down from there, using the reference to your DataGrid
    component.
    Also, make sure you don't have any other onRollOver/Out
    methods defined on the DG component, as I believe any methods
    attached to the button would not trigger.
    Again, make sure you are firing a onRollOver event by using
    the _root.function() call, so you cn maintain your sanity!
    Good luck,
    bh

  • Unable to capture button event in pageLayout Controller

    Hi Guys,
    I have the following layout
    pageLayout
    pageLayoutCO (controller)
    ----header (Region)
    ----------messageComponentLayout (Region)
    -----------------MessageLovInpurt
    -----------------MessageChoice(Item)
    -----------------MessageTextInput
    -----------------MessageLayout
    ----------HideShow (Region)
    -----------------MessageLovInpurt(Item)
    -----------------MessageChoice(Item)
    -----------------MessageTextInput(Item)
    -----------MessageComponentLayout (Region)
    -----------------MessageLayout
    ------------------------SubmitButton(ID:SearchBtn)
    ------------------------SubmitButton(ID:ClearBtn, fires partial action named clear)
    -----------header(Region)
    I am not able to capture the event fired by the button ClearBtn in the controller of the pagelayout.....
    The two methods I used as follows aren't worked:
    if ("clear".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    if (pageContext.getParameter("ClearBtn") != null) {
    what should i do in order to capture the button event in the pageLayout Controller
    Thanks in advance
    Mandy
    Edited by: user8898100 on 2011-8-2 上午7:49

    Mandy,
    Its really strange that its not able to caputure the event in CO.
    Below is the way in which we handle to Submit action at CO level.
    /Check whether ClearBtn is same in case too.
    if(pageContext.getParameter("ClearBtn")!=null){
    System.out.println("Inside the Clear Btn Action");
    Regards,
    Gyan

  • How to Capture Button event on TrainBean navigation

    Hi All
    i m being required to capture a button event in train bean Navigation, i m doing customization in Iexpense Module,here in Create IExpenseReport i need to capture the events of Remove,Return etc.how is it possible any clue would be very helpful.
    Thanx
    Pratap

    try this..
    if (GOTO_PARAM.equals(pageContext.getParameter(EVENT_PARAM))
    "NavBar".equals(pageContext.getParameter(SOURCE_PARAM))
    // This condition checks whether the event is raised from Navigation bar
    // and Next or Back button in navigation bar is invoked.
    int target = Integer.parseInt(pageContext.getParameter(VALUE_PARAM));
    // We use the parameter "value" to tell use the number of
    // the page the user wants to visit.
    String targetPage;
    switch(target)
    case 1: targetPage = "/oracle/apps/dem/employee/webui/EmpDescPG"; break;
    case 2: targetPage = "/oracle/apps/dem/employee/webui/EmpAssignPG"; break;
    case 3: targetPage = "/oracle/apps/dem/employee/webui/EmpReviewPG"; break;
    default: throw new OAException("ICX", "FWK_TBX_T_EMP_FLOW_ERROR");
    HashMap pageParams = new HashMap(2);
    pageParams.put("empStep", new Integer(target));
    pageContext.setForwardURL("OA.jsp?page=" + targetPage,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    pageParams,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO, // Do not display breadcrumbs
    OAWebBeanConstants.IGNORE_MESSAGES);
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Sender File Adapter and content conversion

    Hi, How can we remove the last line from the file using content conversion? The last line should not be read from the input file. Like for the first line we can use Document Offset .......similarly do we have any option for the last line?

  • RESTRICT PURACHSE ORDER CREATION IF INFO RECORD IS NOT MAINTAIN

    HI, I WANT TO RESTRICT THE USER FROM CREATING PURCHASE ORDER (ME21) IF HE HAS NOT UPDATED THE INFO RECORD FOR THE SAME. I WOULD LIKE TO KNOW WHAT ARE THE FIELDS EFFECTED FROM WHICH TABLE AND HOW TO DO IT. WHAT I KNOW IS INFO RECORD (ME11) AFFECTS EIN

  • Classpath

    Good evening, I've searched a lot about this issue and tried several things, but still couldn't get to a solution. I've coded my program with BlueJ. From BlueJ, it runs perfectly, but when I try to run it from the command prompt, I'm getting the erro

  • I am having trouble with sound on my iPad

    I am having trouble with sound on my iPad

  • Applying multiple transitions

    Can someone tell me how to apply transitions to multiple slides in iMovie? I want my slide duration,the fade in, and the fade out all set for 2.5 seconds each. I keep getting error messages and I'm loosing my patience. Every time I try to change a ti