Disable row selection for certain column in JTable

I have a JTable with several columns, one of which contains an "Info" button. I already have it worked out that when I click on the "Info" button, that event gets passed from the JTable to the button. I have multi-select enabled for the JTable, but I don't want clicking on the "Info" button to change the current selection. I have a klugy "fix" working where I save off the current selection, and then restore it after the user presses the "Info" button. However, this results in "flashing" - the row containing the selected "Info" button becomes selected briefly, then the original selection is restored. How can I avoid this? I would like to just ignore selection events on the "Info" column, but still pass the mouse click event through to the button.
Any suggestions?

try this
        JTable table = new JTable() {
            public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend) {
                if (!getColumnModel().getColumn(columnIndex).getIdentifier().equals("Info")) {
                    super.changeSelection(rowIndex, columnIndex, toggle, extend);
                }//else

Similar Messages

  • Hide row values for certain column in GRR2

    Hi Experts,
    Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
    Could somebody let me know is there an way to get this addressed.
    Thanks in advance
    Best Regards,
    gj

    How was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
    I have a smiliar issue of hiding certain rows for few columns.

  • Disable DataGrid row selection for a column?

    Hi,
    I have a DataGrid with a CheckBox in one column. When the CheckBox itself is clicked, or any point in the CheckBox column
    is clicked, I *don't* want the grid row selected. IOW, row selection should be disabled for the column. How to get this behavior?
    Thanks, Garry

    Hi All,
    I do have almost similar requirement where I have image overlay-ed on row, on whose click a context menu should appear but row should not get selected.
    Row selection should happen if user clicks elsewhere on that row (apart from overlayed image).
    I tried below lines in MouseClick event listeners.
    event.stopImmediatePropagation();
      event.stopPropagation();
    Above lines stopped itemClick event but didnt prevent the row selection.
    Regards,
    Pavan

  • Disable Lead selection for table row cloumn

    HI Team,
    I have table with multiple rows and multiple columns.
    Based on the lead selection of the row we are displaying the some form.
    But in table row there are some columns like enter date, when the user is trying to enter the date, it displaying the form because of lead selection and it is not allowing the user to enter the date.
    So, I want disable the lead selection for some columns.
    How can I do this?
    Regards,
    BAla

    Hi
    I think that you can get  the UI Table in the wdDoModifyView method, and then the UI Column and play with his values, is something like this:
    IWDTable table =(IWDTable)view.getElement( ");
    And then play with the "column" methods.
    Josué Cruz

  • Is it possible to disable datatips in columncharts for certain columns?

    Is it possible to disable datatips in columncharts for
    certain columns?

    Hello,
    apologizes for the misunderstanding.
    Regarding security, you might want to have a look at the forum and http://www.sdn.sap.com/irj/sdn/security.
    Back to the original matter, I can tell that modifying or extending the SAP GUI functionality on communication protocol level is quite challenging. The protocol is not published and a binary protocol.
    Depending what your intention is, you might want to have a look at [GuiXT|http://www.guixt.com/].
    Another approach is to write your own controls for SAP GUI, see [How To Extend SAP GUI for Java with Your Own Java Bean |http://www.sdn.sap.com/irj/sdn/sap-gui?rid=/library/uuid/20e0536f-eaf4-2a10-319d-eb68f8e6cee3] on the [SAP GUI family page|http://www.sdn.sap.com/irj/sdn/sap-gui#section16].
    Best regards
    Rolf-Martin

  • Format for certain columns in list view control

    I have a list view control and I would like to format the alignment for certain columns. I heard that the only way you can do this is by formatting the cells in excel. I tried this with no success. Can someone please give me step by step instructions on how to achieve this. I am currently allowing Xcelsius to handle my formatting for money. Is it possible to have Xcelsius handle the money formatting and have excel handle the alignment  formatting. I am open to whatever works at this point. Also I am using Xcelsius 2008 (Build Number 12,2,1,66).
    Much Thx

    Hi,
       In list view control you can format the entire row only, not a certain column.
       Go to property>Appearance>Text Tab>select Header>Format selected text->select the format.
      For width change: Property> Layout Tab>check custom column width the click the icon and enter width in pixel.
    Regards,
    Senthil K

  • Keyboard Access For a Column in JTable with default editor as JComboBox

    I want to get Key board access for a column in JTable.
    The user should be able to select from a drop down list for the column with default
    editor set as JComboBox.
    Presently,it works fine with mouse,also I am able to focus it with Keyboard using
    ALT+Up keys,but how to make drop down list appear.
    Plz help,it's urgent.
    Thanks in Advance

    Hi,
    In addition to setting DO_SUM = 'X' you need to specify function in H_FTYPE field. It should be set to 'AVG' in your case.
    ls_fielcat-do_sum = 'X'.
    ls_fieldcat-h_ftype = 'AVG.

  • HT201299 My Iphone 4s wont remember the disable cellular data for certain apps as I soon as I switch on the 3g and go back to home and come back again to Cellular the all apps are being enabled..Please help

    My Iphone 4s wont remember the disable cellular data for certain apps as I soon as I switch on the 3g and go back to home and come back again to Cellular the all apps are being enabled..Please help

    First, try a reset: hold down the home button along with the power button until you see the Apple, then let go.

  • HT201299 Not enable or disable cellular data for certain iOS apps and features from setting? I keep it off but when I go to other app it on automatic

    I can't  enable or disable cellular data for certain iOS apps and features from  setting.
    When I off data for specific application and go to other option it automatic on all application
    Any one can help

    SOLUTION! (NO NEED TO RESET YOUR IPHONE SETTING!)
    I have the same issue for the last two weeks. But i have already managed to solve the issue all by myself. When i go to Settings > Cellular > below the tab "use cellular data for:", i turned off some apps which i didnt want to use with cellular data. As soon as i go back to Settings, and then i went back to Cellular, the apps which i had switched off earlier, automatically turned back on.
    Here's the solution:
    Either you're using wifi or cellular data, first of all you're gonna hafto turn on the cellular data use for App Store. Once you have turned it on, go to App Store application. Update ALL the apps which have new updates available. If it asks you to log in your App Store, just do so. If there's something wrong with your debit or credit card information, it will ask you to update to a different card. Just do what it asks. Put in a new credit or debit card info and fill in the forms provided. The card you're using must be usable and has usable balance in it. Let's say atleast $10 to $20. As soon as it confirms your card successfully, the app updates will start automatically. Continue to update all the apps. After all updates are finished, go back to Settings > Cellular. Try to switch on or off some apps for data use and recheck.
    Try it yourself! Have a nice day and don't put a blame on Apple for this.
    From Malaysia, with love.
    Please hit LIKE button if this solve your issue. Thank you very much! (:

  • Where can I get a list of available selection for certain dict type?

    Where can I get a list of available selection for certain dict type in code?  For instance, when I use SE16 to view VBFA table, I am presented with many filter criteria.  One of them would be "VBTYP_N".  When I click on the square next to the option, I am presented with a list of possible values to select from.  Where can I get the list of this possible values for any given dict type in code?

    Hi Frank,
    The list of possible selection you see can be from diferent sources
    1) Search helps defined either programatically or search helps defined at table level.
    If it is a Z Selection screen check the program, then the data declaration of the parameter
    2)Check tables provided at field level. They can be through use of foreign keys. The proposal generated could be simple compund ..
    3) Fixed values at Domain level ()
    Please refer to this link as well for detailed explanation
    [http://help.sap.com/saphelp_470/helpdata/en/9f/dbaa5435c111d1829f0000e829fbfe/content.htm]

  • To setup scrollbars for individual columns in JTable

    Hi,
    I need to setup individual scrollbars for the
    columns in JTable.
    Can anybody help?
    Thanks in advance.
    Rgds,
    sita

    Hi,
    I need to setup individual scrollbars for the
    columns in JTable.If i understand you correctly, you want to have a scrollbar for every column. If so, you will need a new instance of JTable and JScrollPane for every column, but that's a lot of work if you want to do it fancy.
    The good news, is you can reuse the table model.
    You could do something like that.
    for (int i= 0; i < model.getColumnCount(); i++) {
        JTable table = new JTable();
        table.setAutoCreateColumnsFromModel(false);
       //container
        someContainer.add(new ScrollPane(table), null/* or some layout constrains*/);
        TableColumn tc = new TableColumn(i, 120);
        tc.setHeaderValue(model.getColumnName(i));
        table.addColumn(tc);
    Can anybody help?
    Thanks in advance.
    Rgds,
    sita

  • Different number of rows for different columns in JTable

    hi
    I need to create a JTable with different number of rows for different columns...
    Also the rowheight should be different in each column...
    say there is a JTable with 2 columns... Col1 having 5 rows and column 2 having 2 rows...
    The rowHeight in Col2 should be an integer multiple of Rowheight in Col1
    how do I do this ??
    can anybody send me some sample code ?????
    thanx in advance

    How about nesting JTables with 1 row and many columns in a JTable with 1 column and many rows.
    Or you could leave the extra columns null/blank.
    You could use a GridBagLayout and put a panel in each group of cells and not use JTable at all.
    It would help if you were more specific about how you wanted it to appear and behave.

  • Multiple keystrokes selection for a JComboBox in JTable

    Has anyone used multiple keystrokes selection in a JComboBox inside JTable before? I can get it done outside JTable by using: http://javaalmanac.com/egs/javax.swing/combobox_CbMultiKey.html
    Looks like JTable has all kinds of problems to support JComboBox.
    Suggestions?
    Thanks,
    James

    If I read you right, you want to use a multiple keystroke combo box as an editor in a JTable?
    If you create the JComboBox as you would like it and then install it as an editor in the column(s) JTable the editor will work like the JComboBox
    Example:
    //- you would have that keyselection Manager class
    // This key selection manager will handle selections based on multiple keys.
    class MyKeySelectionManager implements JComboBox.KeySelectionManager {    ....    };
    //- Create the JComboBox with the multiple keystroke ability
    //- Create a read-only combobox
    String[] items = {"Ant", "Ape", "Bat", "Boa", "Cat", "Cow"};
    JComboBox cboBox = new JComboBox(items);
    // Install the custom key selection manager
    cboBox.setKeySelectionManager(new MyKeySelectionManager());
    //- combo box editor for the JTable
    DefaultCellEditor cboBoxCellEditor = new DefaultCellEditor(cboBox);
    //- set the editor to the specified COlumn in the JTable - for example the first column (0)
    tcm.getColumn(0).setCellEditor(cboBoxCellEditor); Finally, it may be necessary to to put a KeyPressed listener for the Tab key, and if you enter the column that has the JComboBox:
    1) start the editting
    table.editCellAt(row, col);2) get the editor component and cast it into a JComboBox (in this case)
    Component comp = table.getEditorComponent();
    JComboBox cboComp = (JComboBox) comp;3) give this compent the foucus to do its deed     
    cboComp.requestFocus();Hope this helps!
    dd

  • Tabular Form Hide Row Selector for certain rows?

    Hi,
    I was curious if it is possible to hide the row selector checkbox for certain items? For instance
    if a certain value is in a certain column in a row I want to hide the checkbox and in other cases show it...
    Thanks in advance!

    Hi,
    That setting does only work for an entire column.
    There are at least three possibilities:
    1 - Create the checkbox using APEX_ITEM.CHECKBOX (see: [http://download.oracle.com/docs/cd/E10513_01/doc/apirefs.310/e12855/apex_item.htm#CHDDCHAF])
    2 - Create a custom "Named Column (row template)" report template - where you can define the layouts for each row based on up to 4 conditions
    3 - Use javascript to scan data in the other columns and disable or remove the checkboxes where required
    Option 1 is probably easiest but you would need to remove the Row Selector from the report as that is no longer required
    Andy

  • ALV Row Editable for specific column

    Hi,
      I am creating a transaction using ALV  - Webdynpro. I would like to enable or disable the row ,(specific column in that row ).
    Problem is very similar to the thread posted in the below link.
    enable or disable row in alv
    Please let me know how to achive the scenario.
    Thanks,
    Kumar

    Hi Kumar,
    Have a look at [this thread|How to set some rows in ALV to be editable or some non editable.; in which I have given the complete code to solve your problem. There is one post which explains how to set the cell editor, and one more post explains setting the cell as editable or read only.
    You need to bind the read_only property of your node attribute (i.e, whichever column you want this behavior on), to another attribute (say FLD_READ_ONLY) in the same context node. And based on the value in attribute FLD_READ_ONLY, the cell property would be changed. Define this attribute of type char01. So based on your business logic, if you want the cell to be read only, set X in the attribute, and if you want it to be editable, set space.
    I hope that would be clear enough. Please revert for any clarifications. Depending on your requirement, if you want the read_only property to change on lead selection, you can get the lead selection index and set the attribute FLD_READ_ONLY = X / space only for that element. This would make only one cell editable at a time.
    You could also refer to this recent [thread|ABAP WebDynpro: Can edit a cell in a column?; for the same issue, where you would have some additional pointers.
    Regards,
    Nithya

Maybe you are looking for