Double click in tables

Hi,
i would like to get the selected field from a tabel with double clicking on the filed. What kind of action listener, selection listener should i use?
Thx in advance:
james

You can read mouseclicks with the MouseAdapter class. Put it on your JTable like this:
table.addMouseListener(new MouseAdapter(){
     public void mouseClicked(MouseEvent e){
      if (e.getClickCount() == 2){
         // double clicked
   }Inside the handler you can check the selected row/cell to check what the user doubleclicked on.

Similar Messages

  • ***How to Invoke backing bean method by DOUBLE-CLICK the table ROW!!***

    Hi,
    How can I collect the selected row value & navigate to next page by DOUBLE-CLICK the result table row.
    My application got searchResult page where I am displaying the list of user in result table. Then selecting any one row and navigating to master details page by clicking the continue button. Button Action method will collect the selected row userID which I am forwarding to the masterDetails page.
    Same functionality I want to do by double click the row instead of clicking the button!!. I want to trigger the backing bean method if the user double click the row basically. Please help me in this how to do this?
    Current button action method:
    *public String userSelected() {*
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    return "continue";
    *}*

    Puthanampatti ,
    Yes, I am using the same. Below is my code. I am trying to get the object of the MAIN jspx page region (where I am displaying the fragments) and refresh the one. But cant able to get the object for the region it is returning null. without refresh seems the navigation wont work.
    public void doDbClick(ClientEvent clientEvent) {
    FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
    currentRow = binding.getRow();
    selectedNetID = (String) currentRow.getAttribute("netid");
    System.out.println("selectedNetID -->"+selectedNetID);
    requestContext.getPageFlowScope().put("netid",selectedNetID);
    try{
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "continue");
    System.out.println("region obj -->" +facesCtx.getViewRoot().findComponent("advse1"));
    // Refresh the current region; advse1 is the id of the region component inside jspx page
    AdfFacesContext.getCurrentInstance().addPartialTarget(facesCtx.getViewRoot().findComponent("advse1"));
    catch(Exception e){
    System.out.println("Error is: " +e);
    Is this correct coding to get the region object?? actually the "result table" and "Master details" are 2 different fragments which are linked with task-flow and the task flow is part of main jspx page as a region. I am using that region ID to get the obj, but cant able to get so....!!! any idea

  • Navigate to next view activity by double clicking a table row

    Hi,
    I define a simple task flow with two view activilities, View1 ----(showDetail)-----> View2.
    View1 contains a table, when user clicks a row in the table, the task flow should go to View2
    and content displayed in View2 depends on the row selected in View1.
    I define a client listener and server listener to concume the row double click event.
    The server listener is something like this:
    FacesContext fc = FacesContext.getCurrentInstance();
    DashBoard dashBoardBean =
    *(DashBoard)fc.getExternalContext().getSessionMap().get("dashBoardBean");*
    RichRegion contentRegion = dashBoardBean.getTaskf1();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ELContext elc = fc.getELContext();
    MethodExpression me =
    *ef.createMethodExpression(elc, "#{dashBoardBean.getCurrentScreen}",*
    *String.class, new Class[] { });*
    *contentRegion.queueActionEventInRegion(me, null, null, false, -1, -1,*
    *PhaseId.ANY_PHASE);*
    *contentRegion.refresh(fc);*
    This works fine in the sense that I can navigate to View2.
    The problem is that I register a RegionNavigationListener on the region containing this task flow, when I double click a row in View1
    the RegionNavigationListener is not invoked even though region has navigated from View1 to View2.
    Anyone knows any solution for this or is there an alternative way to implement this functionality?
    Thx
    Colin
    Edited by: user10303309 on May 28, 2009 2:51 AM

    Yes, I think Region.refresh does not fire the Navigation Event, I tried to fire an event manually:
    contentRegion.refresh(fc);
    contentRegion.queueEvent(new RegionNavigationEvent(contentRegion, "oldViewId",  "newViewId"));
    But this does not work either....

  • 30EA1 /2.*: Double-clicking objects in the navigator tree

    Hi,
    There is an inconsistency in double-clicking objects in the navigator tree:
    When Preferences - Database - ObjectViewer - Open Objects on Single Click is checked, double-clicking e.g. a table in the navigator will still open it the same way as single-clicking it.
    However, when Preferences - Database - ObjectViewer - Open Objects on Single Click is not checked, double-clicking the table in the navigator will open it, and expand the columns. The latter is quite irritating, especially on large tables.
    Can this be bugged, so double-clicking the table in the navigator will just open it?
    Thanks,
    K.

    The node is expanded on double click irrespective of what the preferenceIs this a typo or does it really expand always for you? For me it only expands with "single click objects" disabled.
    windows explorer also does the sameYes, and I'd even say that's the desired behaviour, especially since it's the only action taken.
    Common sense and standards are against taking 2 different actions at the same time. One should override the other.
    Ideally, double click with "single click objects" disabled would just open the object, and double click with "single click objects" enabled could expand the node as in the Windows Explorer (but doesn't have to).
    So that's almost completely the other way around as we get it now.
    Thanks,
    K.

  • Show field mara-MFRPN in the MP02 without double click

    Hi all,
    Anyone know how to show field mara-MFRPN in MP02?
    I know that once we enter the internal material, it will show a list of MPNs, but in order to view the vendor manufacturer part number, we need to double click on each of it. How can we view mara-mfrpn in the same screen, means on the 1st screen instead of double click?
    Thanks!

    Hi,
    Check ur pf-status. in that did u give PICK to the functionkey F2 which will enable the db click facility.
    apart from setting the PF-status with PICK (F2) also set the property "respond to double click" for the tablecontrol column in screen painter.
    and u can get the values of the clicked field by GET CURSOR command.
    Also you can refer:-
    double click from table control?
    Doubleclick in Table control
    Hope this helps you.
    Regards,
    Tarun

  • Double click event for the I/O field in custom screen

    Hello all:
        I have development a dialog program now, and I want to show the MM03 screen when I double click the I/O field for material number ( such as the CO03 materil field ). I had set the screen display attribute to " Responds to double-cick",but I can't receipt any infor from the PAI Flow but a message "Please choose a valid function".
       some friends proposed me to set the Function Code for it , but the FctCode only support for "button" and "tab titles" and "Dropdown box" , how can I do.

    Hi,
    Check ur pf-status. in that did u give PICK to the functionkey F2 which will enable the db click facility.
    apart from setting the PF-status with PICK (F2) also set the property "respond to double click" for the tablecontrol column in screen painter.
    and u can get the values of the clicked field by GET CURSOR command.
    Also you can refer:-
    double click from table control?
    Doubleclick in Table control
    Hope this helps you.
    Regards,
    Tarun

  • Capture field name in table control on double click

    Hi,
    How can I capture the field name of internal table passed to table control on double click?
    I have set function code as 'PICK' and applied 'Respond to double click' and used GET CURSOR statement. Here I can get the values like row number (line number), field value also. But I would like to capture on which field the cursor is (or on which column the cursor is)?
    Thanks in advance.
    Regards
    Ramesh.

    Got it.
    We can capture it by using the statement GET CURSOR only.
    GET CURSOR field <field xx> .
    Here the <field xx> is the field name where we have said double click.

  • Open T-code on double click of field in table maintenance

    Hi Gurus,
    I have one scenario, I have to show a transaction on double click event on a field of Table Maintence.
    Please guide me in this .
    Is there is any event in Table Maintenance Events to capture double_click of a field.
    Regards,
    Sowmen

    1. In the field attributes of the particular field there is a chechbox  in display tab which says respond to double click, check that.
    2. Assign the fuction code "PICK" for function code F2 in GUI status.
    3.Now whenver you double click the field function code "PICK" gettes triggeed.
    Now you can wrie yyou code based on this function code.
    CASE sy-comm.
    WHEN 'PICK'.
    *If you want the name of the field and the value in that field use the below code.
    GET CURSOR FIELD gv_field VALUE gv_cursor_value.
    *DO your operation based on the field and the value.
    ENDCASE.
    Regards,
    Smithesh

  • Open file from table with double click

    Hi all,
    I use adf faces and JDEV 11.
    I want to open a file by double clicking on row in a table. (file is stored in the database).
    I first tried it with a button to open the file, with this code:
           System.out.println("Double click!");       
           BindingContainer bindings = this.getBindings();
            DCIteratorBinding iter = (DCIteratorBinding)bindings.get("XxahelpBezoekRapDocView1Iterator");
            Row row = iter.getCurrentRow();
            FacesContext fc = FacesContext.getCurrentInstance(); 
            HttpServletResponse response = (HttpServletResponse)fc.getExternalContext().getResponse();
            response.setHeader("Content-Disposition","attachment; filename=\""+row.getAttribute("Filename").toString()+"\"");
            response.setHeader("cache-control", "no-cache");
            try {
                InputStream in;
                in = ((BlobDomain)row.getAttribute("Bijlage")).getInputStream();
                ServletOutputStream out = response.getOutputStream();
                writeInputStreamToOutputStream(in, out);
                fc.responseComplete();     
            } catch (IOException e) {
                e.printStackTrace();
            } This is working fine.
    Now I wan't to open the file with double clicking on a row.
    For opening the file I use the same code in the backing bean and this code on the page:
          <f:facet name="metaContainer">
        <af:group>
            <trh:script>
               goEditRow = function(event) {
                    AdfCustomEvent.queue( event.getSource(), "doubleClickOnRow", {}, false);
            </trh:script>
        </af:group>
        </f:facet>And a clientListener and serverListener on the table:
    <af:clientListener method="goEditRow" type="dblClick"/>
    <af:serverListener type="doubleClickOnRow" method="#{backingBeanScope.backing_pages_EditTicket.doubleClick}"/>The only thing that happens when I double click is that I see "Double click!" in the console. But I can't save the file :S
    What is the problem?
    Thanks in advance.

    Hi
    What we do is to pick a table column for downloading the file.
    We change the component in the column to the an af:commandLink and add an
    af:fileDownLoadActionListener to the command link.
    The user clicks on the link to download (open) the file.
    Its not exactly the same as what you requested (double
    click on the row) but it might be another solution.
    Regards
    Paul

  • How to do lead select and double click on a row of table simultaniously ?

    Hello All,
    I am creating a freely programmed search help to search Material Number.
    i am displaying the values in normal table ( Not ALV ) on the search help popup.
    My requirement is
    when I select a row and click on OK button the Material number in that row is getting captured ( This is working fine for me)
    At the same time I also want to capture the value when user double cluck on the particular row.
    I am not able to do both on action methods simultaneously as I am getting syntactic error.
    i.e. When I create action method on the event "on_lead_select" and the event "On select"  and try to save Check & activate it throws error.
    Please find the screen shot below.
    Standard webdynpro component WDR_F4_ELEMENTARY was able to achieve this functionality some how, I have debugged it but didn't get the solution

    Hi,
    There is no double click provision. In the table you could change the cell editor of column to LinktoAction UI, then onclick of that you can set the selected value.  And in the component WDR_F4_ELEMENTARY its not a normal table UI but its a CTable UI, you can try creating a CTable and create an Action for onSelect.
    Regards,
    Kiran

  • How to make Double Click To Edit work instead of ClickToEdit for Af:Table

    Hi All,
    We use AF:Table in clickToEdit mode and most of the time the users use this table for selecting a master record then work on the detail records. To avoid the cost of rendering the selected row as editable we would like to change the behavior to Double Click To edit. This way the user can intentionally put the selected row in edit mode when needed. What would be the best approach to achieve this ?
    We use 11.1.1.6 and ADF BC.
    Thanks

    Not sure if you can get it to work in 11.1.1.6.0 as you don't have the ActiveRowKey property which can be used to make a table row editable. The property comes with 11gr2.
    What you can try is to set the tabel to clicktoedit, add a clientListener which you use to listen to the click event and then cancel the event. Add another clientListener whihc handles the doubleClick event, make the clicked row the current row (see http://www.oracle.com/technetwork/developer-tools/adf/learnmore/56-handle-doubleclick-in-table-170924.pdf) and, well now comes the problem, make the current row editable. I don't know how to do this without the ActiveRowKey property.
    One other possible solution is a trick described here http://dstas.blogspot.com/2010/08/press-edit-button-to-make-table-row.html
    here a transient attribute is used to manipulate the isEditable() status of an attribute of the VO. This should do the trick, but is much more work.
    May be someone else knows a better solution.
    Timo

  • How to handle double click in a table control?

    Hi,
    Can any one let me how to handle double click event in a table control in dialog programming?
    here i need to navigate to another screen when user double click on the table contols (emp number column).
    thanks in advance,
    PrasadBabu.

    to define double click in your table controlwhich is similar to 'PICK' function. Enable F2 in PF-status for this
    Table Control Question
    Check the above thread which was posted recently on SDN, please award points if found helpful

  • How to handle double click on af:table ?

    ..... I use JDev 11g .......
    I have an af:table I want when I double click on row in this table I execute a method in backing bean.
    ( I know there is a selectionListener in table but this for single click I want a method call only if I double click on the table )
    How can I do that?
    Thank You...
    Sameh Nassar

    You may use this method.
    1. Register a client listener on the table:
    <af:clientListener type="dblClick" method="doDbClick"/>
    The method doDbClick is a javascript function:
    <trh:script>function doDbClick(event) { 
    var source = event.getSource();
    AdfCustomEvent.queue(source,"doDbClick", {}, false);
    </trh:script>
    2. Register a server listener on the table to consume this custom event:
    <af:serverListener type="doDbClick" method="#{backingBeanScope.txnBean4.doDbClick}"/>
    The java method:
    public void doDbClick(ClientEvent event){
    // do whatever u want
    Colin

  • How to get index of the item from table when user double click on an item

    Can anyone tell me how to get the corresponding index of a table in which
    elements are listed as array of strings? I am looking for the index of the
    item being double-clicked on?
    Thank you in advance
    Cheers,
    NQ.

    Hi NQ,
    Although the question is not thouroughly clear, I can give a few suggestions. You can use the property node for table to refer to any particular row or column of the table. The correpsonding elements in the property node will be "SelStart", "SelSize" etc. Just as a side thought, the index of a table starts with (0,0).
    I am attaching a test file. Please see if it helps you in figuring out what exactly you want. This example VI is just to help you try different options under property node (if you havent already tried)to get what you want.
    Regards,
    Sastry Vadlamani
    Applications Engineer
    National Instruments
    Attachments:
    test.vi ‏27 KB

  • Double Click Event not fired for IE 11 with compatibility mode for HTML elemnt table

    Hi,
    I am facing an issue with Double click event(not getting fired on double click of mouse) for IE 11 with compatibility mode on HTML element "table" for Windows 7 64 bit machine.It runs fine on IE 10 with compatible mode with Windws 7 64  bit
    machine -- double click event.
    Can you please help to resolve the issue?
    Thanks and Regards,
    Yogesh

    Hi,
    f12>Debug tab, click the 'start' button.....(select break on all exceptions from the dropdown on the Debug tab)
    click your table and correct any errors that are listed in the Console of the developer tool.... probably you are using attachEvent I/o addEventListener. You should be using addEventListener for IE9 and higher and other web browsers.(it the w3c standard
    (recommendation).
    Post questions about html, css and scripting for website developers to the MSDN IE Web Development forum. Include with your question a link to your website or a mashup that shows the issue.
    Rob^_^

Maybe you are looking for