Double click on a JTable row.

I got and run a sample about double click on a JTable and it works fine. This sample defines a TableModel as shown at the end this note.
On the other hand, I have an application in which I have defined a JTable
using the DefaultTableModel as follows :
DefaultTableModel dtm = new DefaultTableModel(data, names);
JTable table  = new JTable(dtm);  where data and names are String arrays.
Of course the mouse listener stuffs have been also specified.
table.addMouseListener(new MouseAdapter(){
     public void mouseClicked(MouseEvent e){
      if (e.getClickCount() == 2){
         System.out.println(" double click" );
     } );Because the difference with the sample was the table model,
I changed it with the DefaultTableModel class. At this point, the Double click does not work anymore.
So I gues it should be an option which prevents double click to work.
I thought of using mousePress() instead of mouseClick(), but it's very dangerous (I tried). . If by error the user clicks twice (instead of only once) the mousePress method is invoked twice for the same entry
My question is now simple, may I use double click on a JTable with the default table model. If so, what I have to do ?
Thanks a lot
Gege
TableModel dataModel = new AbstractTableModel() {
     public int getColumnCount() { return names.length; }
     public int getRowCount() { return data.length;}
     public Object getValueAt(int row, int col) {return data[row][col];}
     public String getColumnName(int column) {return names[column];}
     public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
     public void setValueAt(Object aValue, int row, int column) {
       data[row][column] = aValue;
     };

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class ClickIt extends MouseAdapter
    public void mousePressed(MouseEvent e)
        JTable table = (JTable)e.getSource();
        Point p = e.getPoint();
        if(e.getClickCount() == 2)
            System.out.println("table.isEditing = " + table.isEditing());
        int row = table.rowAtPoint(p);
        int col = table.columnAtPoint(p);
        String value = (String)table.getValueAt(row,col);
        System.out.println(value);
    private JTable getLeftTable()
        final String[] names = { "column 1", "column 2", "column 3", "column 4" };
        final Object[][] data = getData("left");
        TableModel dataModel = new AbstractTableModel() {
            public int getColumnCount() { return names.length; }
            public int getRowCount() { return data.length;}
            public Object getValueAt(int row, int col) {return data[row][col];}
            public String getColumnName(int column) {return names[column];}
            public Class getColumnClass(int col) {return getValueAt(0,col).getClass();}
            public void setValueAt(Object aValue, int row, int column) {
                data[row][column] = aValue;
        JTable table = new JTable(dataModel);
        return configure(table);
    private JTable getRightTable()
        String[] colNames = { "column 1", "column 2", "column 3", "column 4" };
        JTable table = new JTable(new DefaultTableModel(getData("right"), colNames));
        return configure(table);
    private Object[][] getData(String s)
        int rows = 4, cols = 4;
        Object[][] data = new Object[rows][cols];
        for(int row = 0; row < rows; row++)
            for(int col = 0; col < cols; col++)
                data[row][col] = s + " " + (row*cols + col + 1);
        return data;
    private JTable configure(JTable table)
        table.setColumnSelectionAllowed(true);
        table.setCellSelectionEnabled(true);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        table.setPreferredScrollableViewportSize(table.getPreferredSize());
        table.addMouseListener(this);
        return table;
    private JPanel getContent()
        JPanel panel = new JPanel(new GridLayout(1,0,0,5));
        panel.add(new JScrollPane(getLeftTable()));
        panel.add(new JScrollPane(getRightTable()));
        return panel;
    public static void main(String[] args)
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setContentPane(new ClickIt().getContent());
        f.pack();
        f.setVisible(true);
}

Similar Messages

  • Double click in a JTable row

    Hi,
    I have the following problem. I would like to have a JTable with single selection (this is ok so far), but I would like it to have the following behaviour.
    If a row is clicked, it becomes selected. If a selected row is clicked again it becomes deselected.
    Does anyone have any suggestions?
    Thnx,
    G

    I am writing about JTree rather than JTable ... because there are no other replies I figured it's better than nothing ...
    This code does the behavior you describe to a JTree.
    (Code snippet copied from JTree javadoc page and modified by me.)
    java.awt.event.MouseListener ml = new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent e) {
    int selRow = tree.getRowForLocation(e.getX(), e.getY());
    if(selRow != -1) {
    if(e.getClickCount() == 1) {
    System.out.println("SINGLE CLICK");
    else if(e.getClickCount() == 2) {
    System.out.println("DOUBLE CLICK");
    tree.clearSelection();
    tree.addMouseListener(ml);
    I put the print statements in to demonstrate that a double-click event actually is a single-click followed by a double-click. Since you didn't sound like you need to do any custom code for the single-click case, this fact probably doesn't affect you.
    I hope I helped
    Mel

  • How to start a function when double-clicked in a JTable

    hi there,
    i got a problem, i want that my JTable reacts when i make a double-click on any row... so that i can start a method that does the things i want to...
    how can i realize that?
    thx anyway
    Errraddicator

    i got a problem, i want that my JTable reacts when i
    make a double-click on any row... so that i can start
    a method that does the things i want to...
    how can i realize that?Easy, just put a mouse listener on it the same way you would a button! In the listener method, you can use
    if ( event.getClickCount()>1 ){
    doWhatever();
    doug

  • Reaction on a double click in a JTable

    Hello guys,
    I need to react on a double click on some row in a JTable. I know it must be simple, but I can't find a way to do it!
    Any help will be appreciated.

    Here is a code snipplet out of an application of mine.
    The purpose is to do the same action on double click that would be done by pushing the OK button.
            // Take selected order item on double click.
            this.table.addMouseListener(new MouseAdapter() {
                public void mouseClicked(final MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        Point origin = e.getPoint();
                        int row = OrderSearchDlg.this.table.rowAtPoint(origin);
                        if (row > -1) {
                            okActionPerformed();
            });

  • Double click in alv report rows

    Hi to all!!
    I have an alv report and I want it to go directly to a transaction IW38 when I double click the row, I know that i have to use the reuse_alv_grid_display's IT_EVENT parameter and also the I_CALLBACK_USERCOMMAND but I don't know exactly how.
    Can anybody show me an example or help me?
    THANKS A LOT!!!

    Hi,
    Take a look at the following code ( 2 main perform ):
    *       ITAB_user_command                          *
    FORM itab_user_command  USING ucomm TYPE sy-ucomm
                            s_selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
    *     Call Transaction MM03
          IF s_selfield-fieldname = 'MATNR' .
           READ TABLE t_bom INDEX s_selfield-tabindex.
            SET PARAMETER ID 'MAT' FIELD t_bom-matnr.
            CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    *&      Form  display_data
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
    *           i_background_id             = 'SIWB_WALLPAPER'
                i_background_id             = 'ALV_BACKGROUND'
                i_callback_program          = w_repid
    *           i_callback_html_top_of_page = w_html_top_of_page
    *           i_structure_name            = 'TRDIR'
                i_bypassing_buffer          = 'X'
                i_default                   = 'X'
                i_save                      = w_variant_save "'A'
                is_variant                  = w_variant
                is_layout                   = w_layout
                i_callback_user_command     = 'ITAB_USER_COMMAND'
    *            i_callback_pf_status_set    = 'SET_PF_STATUS'
                it_fieldcat                 = i_fieldcat_alv[]
                it_events                   = i_events[]
                it_event_exit               = i_event_exit[]
    *            it_excluding                = i_excluding
                is_print                    = w_print
    *           i_screen_start_column       = 1
    *           i_screen_start_line         = 1
    *           i_screen_end_column         = 70
    *           i_screen_end_line           = 30
           TABLES
                t_outtab                    = t_bom
           EXCEPTIONS
                program_error               = 1.
    ENDFORM.                    " display_data
    Best regards,
    Erwan

  • Agentry - Disable Double Click Action on Individual Row

    Is it possible to disable the double click action on a single row in a list screen?  I wanted to have a rule that would disable a row if it has already been updated.  Let me know if that is possible.

    The double click option can not be set by a rule or not, but the action is called, you can put an enable rule on to check the data already.
    Stephen

  • Previous entered value is lost when double click in the Jtable cell.

    Hi,
    When I double click the cell in the Jtable, the pervious enter data is lost. I unable to mask the double click event also. Could you please help me out.
    Thanks in Advance,
    With Thanks and Regards,
    Shiva

    When I double click the cell in the Jtable, the pervious enter data is lost.No it isn't unless you've customized the code and made an error.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Double click event for JTable.....

    All,
    I would like to display some data on double_click a selected row from the JTable. How do I code the double_click event in the following program. Please advise.
    Here is the code:
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Vector;
    class TableTest extends JFrame {
    MyTableModel myModel;
    JTable table;
    JButton button;
    JButton buttonQuery;
    int count = 0;
    public TableTest() {
    myModel = new MyTableModel();
    table = new JTable(myModel);
    table.setPreferredScrollableViewportSize(new Dimension(500, 200));
    JScrollPane scrollPane = new JScrollPane(table);
    //Add the scroll pane to this window.
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    getContentPane().add(button = new JButton("Add Row"),
    BorderLayout.SOUTH);
    getContentPane().add(buttonQuery = new JButton("Query"), BorderLayout.NORTH);
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Object [] aRow = new Object [8];
    for (int i=0; i<5; i++) {
    aRow = new Integer(count+i);
    myModel.addRow(aRow);
    count += 10;
    buttonQuery.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.out.println(myModel.getRowCount());
    System.out.println(myModel.getValueAt(1, 3));
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    class MyTableModel extends AbstractTableModel {
    protected final String[] headers =
    { "No", "Vehicle No", "Date of Loss", "Image Type", "Image Description", "Claim Type", "Scan Date", "User Id" };
    Vector data;
    MyTableModel() {
    data = new Vector();
    public int getColumnCount() {
    return headers.length;
    public int getRowCount() {
    return data.size();
    public Object getValueAt(int row, int col) {
    if (row < data.size() && col < 8) {
    Object [] aRow = (Object []) data.elementAt(row);
    return aRow[col];
    } else {
    return null;
    public void addRow(Object [] aRow) {
    data.addElement(aRow);
    fireTableRowsInserted(data.size()-1, data.size()-1);
    public static void main(String[] args) {
    TableTest frame = new TableTest();
    frame.pack();
    frame.setVisible(true);
    }

    Thanks, but I get 1 error:
    'Cannot resolve symbol' -class MouseInputAdapter
        import java.awt.event.MouseAdapter;
    Also say if I need to get 'column data' from selected
    row, what will be the command like ?
        int col = table.columnAtPoint(p);>
    Best Regards

  • Mouse Double Click on an editable cell of JTable

    Hi Pros:
    Maybe this is an old question but no answser from Forum.
    I have a JTable with adding MouseListener. I tried to put double click behavior on nay row in the table. The problem was that this action can obly work on the uneditable cell and do not work on editable cell.
    Anyone have ideas and help me.
    Thank you!

    Hi Wang,
    I have a problem similar to the one you have some time back.
    I have a query for which I need to use PreparedStatement .The query runs likes this :-
    String str = " Select ? , ename from emp where deptno ? ";
    The values of ? need to be assigned dynamically.
    But I cannot create Prepared Statement from this query .
    If you have got answer to your questions can you inform me at
    [email protected]
    Thanks in advance

  • How to process double click on rows of data displayed on html page?

    I need to display rows of data so that user could double click on a particular row to get more details.
    What I could think of doing is to embed an applet with a JTable that could easily process double click event. But the issues I have are:-
    1. I am not able to pass the data (the jsp got from processing some javabeans) to be displayed on the applet's table. It seems the applet needs to get loaded on the user's browser first and then the applet could ask the server (servlet / jsp) to send the data.
    Is there any way to provide data to applet other than html's parameter/value pairs?
    2. As per design, this applet should be used only to display the content. Double click on a row would only open a browser window to display the entire details of the data; there should not be any interaction with the server.
    Is there a better, more elegant way of doing this?
    Thanks.

    I posted a thread on Applet servlet communication here:
    http://forum.java.sun.com/thread.jsp?forum=33&thread=205887
    It uses the ObjectOutput/InputStream so you can send serializable objects rather than just text.
    Cheers,
    Anthony

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

  • Make Double Click event on Row, Matrix

    Hi All,
    I'm new in SDK and sorry for my English.
    Please show me how to make double click event on Row of  Matrix, i have created a table contain all Draft which Docstatus is open and order by ObjType(DocType), but i can't using Link Button on DocNum Column to view Object Detail . I think another way to do that is make a double click event on each row of matrix. Can I do like that ? plz show me . Thank for any suggestion.
    Thanks

    Hi Shafi,
    This is my .srf file
    <items><action type="add"><item uid="MTX_Data" type="127" left="15" tab_order="0" width="620" top="41" height="285" visible="1" enabled="1" from_pane="0" to_pane="0" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1"><AutoManagedAttribute /><specific SelectionMode="2" layout="0" titleHeight="19" cellHeight="19" TabOrder="0">
    This is my code draw a form with matrix
    Private Sub DrawForm()
            Try
                'Read File interface
                LoadFromXML("DraftOpen.srf")
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
            oForm = SBO_Application.Forms.Item("DRFOPEN")
            ' Add Items       
            ' Add a matrix
            oMatrix = oForm.Items.Item("MTX_Data").Specific
            oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single
    This is my event
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            If pVal.FormUID = "DRFOPEN" And pVal.ItemUID = "MTX_Data" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK And pVal.BeforeAction = True Then
                Try
                    oForm = SBO_Application.Forms.Item("DRFOPEN")
                    Dim omatrix As SAPbouiCOM.Matrix
                    omatrix = oForm.Items.Item("MTX_Data").Specific
                    If omatrix.RowCount > 0 Then
                        For i As Integer = 1 To omatrix.RowCount
                            If omatrix.IsRowSelected(i) = True Then
                                MessageBox.Show(omatrix.Columns.Item(1).Cells.Item(pVal.Row).Specific.value)
                                MessageBox.Show(omatrix.Columns.Item(2).Cells.Item(pVal.Row).Specific.value)
                            End If
                        Next
                    End If
                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try
            End If
    please help me to check this code. i don't know why it's still not working with double click event. sorry to disturb you.
    Edited by: PeterHoang on Aug 30, 2011 10:15 AM

  • Double click functionality in Webdynpro ABAP ALV

    Hello!
    I have web dynpro application with ALV Table.
    I need to reproduce the standard R/3 functionality: after the double clicking on the table row the new window with content of that row's fields should appear in the form layout .
    For example, such functionality we have in the RSDMD transaction.
    So I have two questions:
    1. How to catch double click in the alv table of the  Web dynpro application;
    2. How to represent information from the alv table row in the form layout?
    Could you please help me?
    Thanks,
    Mariya

    Hi Maria,
    Say suppose I am displaying the information from SFLIGHT in an ALV format & when I click on any 1 row's CARRID I would like to fetch the corresponding BOOKING details for that particular combination of CARRID, CONNID & FLDATE then I can proceed as follows:
    1) Make the CARRID cell of your ALV to appear as an LinkToAction
    2) Create an event handler for the ON_CLICK event of the ALV & within this event handler fetch the information about the row's CARRID, CONNID & FLDATE. Call a popup window and display the corresponding information in this row.
    Below is the code to make your CARRID field as an LinkToAction:
    METHOD wddomodifyview .
      wd_this->build_alv( ).
    ENDMETHOD.
    METHOD build_alv .
      DATA:
        lr_alv_usage       TYPE REF TO if_wd_component_usage,
        lr_if_controller   TYPE REF TO iwci_salv_wd_table,
        lr_config          TYPE REF TO cl_salv_wd_config_table,
        lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lt_columns         TYPE        salv_wd_t_column_ref,
        lr_link            TYPE REF TO cl_salv_wd_uie_link_to_action,
        lr_checkbox        TYPE REF TO cl_salv_wd_uie_checkbox,
        lr_image           TYPE REF TO cl_salv_wd_uie_image.
      FIELD-SYMBOLS
        <fs_column> LIKE LINE OF lt_columns.
    * Instantiate the ALV Component
      lr_alv_usage = wd_this->wd_cpuse_alv( ).
      IF lr_alv_usage->has_active_component( ) IS INITIAL.
        lr_alv_usage->create_component( ).
      ENDIF.
    * Get reference to model
      lr_if_controller = wd_this->wd_cpifc_alv( ).
      lr_config        = lr_if_controller->get_model( ).
    * Set the UI elements.
      lr_column_settings ?= lr_config.
      lt_columns = lr_column_settings->get_columns( ).
      LOOP AT lt_columns ASSIGNING <fs_column>.
        if <fs_column>-id = 'CARRID'.
          CREATE OBJECT lr_link.
          lr_link->set_text_fieldname( <fs_column>-id ).
          <fs_column>-r_column->set_cell_editor( lr_link ).
        ENDif.
      ENDLOOP.
    ENDMETHOD.

  • Opening humantask in BPM WorkSpace with double click runs 2 instances

    Hello BPM experts,
    I have this standard scenario:
    User opens a task by double clicking on a task row in BPM Workspace task list. Then the task is opened both in popup and in the worspace window (below the task list table).
    My question is how can I make workspace open only 1 form instance?
    Example:
    -double click would open only popup with form in it (no task is opened under the worklist)
    -single click would open only form in bpm workspace window (as it is now)
    Any ideas and help is appreciated!

    Hi,
    Why do you double click on it??
    Anyway that is the way it is..
    I thought it is opening two different windows.
    just click once and you should be able to see only in the bottom part of the same window.
    If you double click it will open another window and it will show in the bottom part also.
    Hope helps ...
    Thanks,
    nir

  • Double Click event on table

    I need to allow selection of table row on double click - I implemented this functionality as suggested in article "http://technology.amis.nl/blog/3845/adf-11g-richfaces-handling-the-client-side-double-click-to-invoke-a-server-side-operation". I noticed the double click works fine if I click on any part of the row that is empty (without text). If i double click on the text that is displayed on the column cell - it just highlights the text and does not invoke Java script method for handling double-click event. I have set table 'rowselection' to 'single'. I am using Jdeveloper 11.1.5 and Firefox (3.1.16) browser.
    Any one else has experienced this issue, is there any solution for this.

    Thanks Timo for your response. I am seeing this odd behavior when using pageflowscope managed bean.
    1). I have a page (part of unbounded taskflow) that has commandlink which invokes a task flow as dialog (inline-popup):
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" title="testw">
    <af:form id="f1">
    <af:panelGroupLayout id="pgl1">
    <af:commandLink text="Link"
    id="cl1" useWindow="true"
    immediate="true"
    windowHeight="500" windowWidth="600"
    windowEmbedStyle="inlineDocument"
    inlineStyle="text-align:left;"
    action="testflow"/>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    2). The inline popup has a table where I am using double click event on a row.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1" clientComponent="true">
    <af:table value="#{TestdblClick.list}" var="row"
    rowBandingInterval="0" id="t1" rowSelection="single"
    clientComponent="true" binding="#{TestdblClick.contactTable}"
    emptyText="no data" columnStretching="last">
    <af:clientListener method="dblkfunction" type="dblClick"/>
    <af:serverListener type="doubleClickOnRow"
    method="#{TestdblClick.doubleClick}"/>
    <af:clientListener method="singlelkfunction" type="selection"/>
    <af:serverListener type="singleClickOnRow"
    method="#{TestdblClick.singleClick}"/>
    <af:column sortable="false" headerText="Col1" align="start" id="c3"
    rowHeader="unstyled">
    <af:outputText value="#{row.col1}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="Col2" align="start" id="c2">
    <af:outputText value="#{row.col2}" id="ot3"/>
    </af:column>
    <af:column sortable="false" headerText="Col3" align="start" id="c1">
    <af:outputText value="#{row.col3}" id="ot2"/>
    </af:column>
    </af:table>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript">
    function dblkfunction(event) {
    var source = event.getSource();
    AdfCustomEvent.queue(source, "doubleClickOnRow",
    },false);
    function singlelkfunction(event) {
    var source = event.getSource();
    AdfCustomEvent.queue(source, "singleClickOnRow",
    false);
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    TestdblClick.java
    ====================
    public class TestdblClick {
    public TestdblClick() {
    private RichTable contactTable;
    private List<Testdata2> list = null;
    public List<Testdata2> getList() {
    this.list = new Vector<Testdata2>();
    Testdata2 t1 = new Testdata2 ("joe", "demaggio", "contact");
    Testdata2 t2 = new Testdata2 ("joe2", "demaggio2", "contact");
    Testdata2 t3 = new Testdata2 ("joe3", "demaggio3", "contact");
    list.add(t1);
    list.add(t2);
    list.add(t3);
    return list;
    public void setList(List<Testdata2> list) {
    this.list = list;
    public void singleClick(ClientEvent clientEvent)
    System.out.println("------single click------");
    public void doubleClick(ClientEvent clientEvent)
    System.out.println("------doubleclick------");
    public void setContactTable(RichTable contactTable) {
    this.contactTable = contactTable;
    public RichTable getContactTable() {
    return contactTable;
    If I make "TestdblClick" managed bean as request scope to handle double-click event it works fine, however if I make "TestdblClick" managed bean as pageflow scope (task flow) it does not work when double click is on a text within the table row. I am not sure why pageflowscope should impact the double-click behavior.

Maybe you are looking for

  • Can I stream from iphone 3g to apple tv

    I Just moved and cannot get cable/internet for another week. Soo... My iphone has internet (duh!) but cannot support a wireless hotspot. I also have at my disposal a MacBook Pro and an airport express. What I would like to do is stream from my iphone

  • Import iview not working??

    Hi all  We have installed  the portal ep 6 sp 17  without  kmc  on linux  everything is working fine  except one iview  that is   import iview      under    system administrator - transport- import   it is giving following error     An exception occu

  • LR4 resizes .dng when I dont want it to

    Exporting my .nef files to .dng after editing them see's them going from full size 4692x3108 to 1024x768. Why?? I can save as .tif ok no problem. Using win 7 and latest LR version 4. Any help appreciated.

  • HT1766 where do i find the itunes  tab

    where do i find the preference tap in itones on my hp laptop app?

  • Hi i need to know how to change my security questions cause i dont remember my answers

    i have a few aers whit my apple acount and i dntremember my answers for the security question and i dont know how to recover it back or how can i change it please any help