Unable to check / uncheck a checkbox in a JTable...

Hi all,
I know that a lot of people have asked this question before but I am unable to find a solution even after going all the messages. My issue is:
My initial rendering of the checkboxes inside the table works ok. I am using a TableCellRenderer and my input to determine the "checked/unchecked" is string like "true" or "false" and not boolean values. But I am unable to do check / uncheck any of the checkboxes.
I would really appreciate any pointers.
Thanks in advance.
Below is my code snippet:
public Component getTableCellRendererComponent(JTable table_,
Object value_, boolean isSelected_, boolean hasFocus_, int rowIndex_,
int colIndex_)
Component component = super.getTableCellRendererComponent(table_,
value_, isSelected_, hasFocus_, rowIndex_, colIndex_);
indicator = table_.getColumnModel().getColumnIndex("IND");      
if (indicator == colIndex_)
     if (value_.equals("true")){
          component = new JCheckBox("", true);           
     } else {
          component = new JCheckBox("", false);           
     return component;
}

Your TableModel has to indicate that the column is editable. Your TableModel also has to implement setValueAt() so that when the user changes the value, it updates the data.
The table will know to use it's own boolean renderer/editor for that column because it knows what to do when a column returns a Boolean.

Similar Messages

  • Unable to check/uncheck older podcast episodes in iPod sync to iTunes 11.0

    Hi,
    I have a few podcasts in my iTunes where I have saved a large number of episodes. Now I have upgraded to the new version of iTunes I unable to check/uncheck older podcast episodes from iPod syncing - the finder window won't scroll to the bottom of the list, and just 'bounces' after scrolling past a certain number!
    Not sure if this is a bug, or I'm overlooking something.
    Thanks

    I have the same problem.  Scrolling does not work in the iPod podcast list panel, but it works in every other panel or window in iTunes...

  • Use spacebar to check/uncheck a checkbox in a datagrid.

    I have a DataGrid that has checkbox in the first column. The user wants to be able to check/uncheck the checkbox when he selects a row, by mouse or up and down keys, and hits the spacebar. Currently the spacebar functions if the last thing that the use has clicked on is the Checkbox. If the user clicks in the cell where the checkbox in located(not the checkbox itself), the spacebar won't do anything.
    <mx:TabNavigator>
         <mx:VBox>
              <ms:datagrid id="lgGrid" dataProvider="{this.lData}">
                   <mx:columns>
                        <mx:Array>
                             <mx:DataGridColumn dataField="vis" id="dfID" sortable="false">
                                  <mx:itemRenderer>
                                       <mx:Component>
                                            <mx:CheckBox click="data.vis = !data.vis"  paddingLeft="4"/>
                                       </mx:Component>
                                  </mx:itemRenderer>
                              </mx:DataGridColumn>
                              <mx:DataGridColumn dataField="name"/>
                        </mx:Array>
                   </mx:columns>
              </ms:datagrid
       </mx:VBox>
    </mx:TabNavigator>

    Your TableModel has to indicate that the column is editable. Your TableModel also has to implement setValueAt() so that when the user changes the value, it updates the data.
    The table will know to use it's own boolean renderer/editor for that column because it knows what to do when a column returns a Boolean.

  • Unable to check the "calendars" checkbox in isync

    I want to Sync my calendars with my razr phone, but when i try to check the calendars checkbox, a dialog box pops up telling me i need to start ical, I click the open ical button, ical opens, but the checkbox still does not check. I click the box again, the same dialog comes up, but ical is already open.
    note: I can sync contacts just fine.
    what do i need to do to fix this?
    thanks!

    Welcome to Apple Discussions.
    You may have lost the appropriate level of permissions required to modify the iSync preferences file, or it may have been corrupted. You can first attempt to fix disk permissions, using the Disk Utility application.
    If that does not correct the issue, navigate to this folder:
    Macintosh HD:Users:<username>:Library:Preferences
    and remove the com.apple.isync.plist file, then relaunch iSync. That should allow you to once again drop down the configuration pane for your device and set the options once again for both contacts and calendars.

  • Unable to check the calender checkbox

    i switched from entourage 2004 and sallings sync app to the mail , ical (v2.0.3[1055])and adressbook combination. and today i wanted to sync (isync 2.1.1. [89.0])my recent adressbook entries and and ical calenders in a clean sync over to my k750i.
    but there the problems started. in the k750i custom view at the calender part it showed up at the "all" radio button and the "custom" radio button only the standard selection of calenders. but not my recent one i hacked in before. tried to deactivate and reactivate calender checkbox. still no show up of my actual calenders. then tried to reset the sync settings in the preferences and quit isync and removed preference plist of the isync settings. but after restart the following showed up.
    the calender checkbox was unchecked. and when i tried to recheck it the following alert panel showed up :
    do you wanna use ical as standard calender app?
    before you are able to sync your calender you have to start up a calender app which is supporting osx synchronisation.
    offers me the choice to cancel or to open ical. but in both cases nothing happens. the checkbox remains unchecked :((((( does anybody has a slight idea how to bend those problems and to be able to use my setup normally? any suggestions would be appreciated. cheers k:d

    deleting all preferences and resetting all devices helped somehow. cheers k:d

  • Checking Unchecking of JCheckBox value  inside JTable cell

    My problem is that i have jtable which has table data. In that first column has jcheckbox values which are there because of the tabledata has firstcolumn values as boolean, to know the no of checks in jcheckboxes in jtable, there is count variable which needs to be dynamic. When i first check the box the variable that i have set to know the check i.e count increases by one, then next jcheckbox if i check then count goes to 2, but real problem is when i do some 2 events on same checkbox then ie. if i check the jcheckbox , the count increases but after that the jcheckbox doesnot listen to events fired. Any help is appreciated

    The example from above shows how to add Objects to a table. If you want a column of checkBoxes then simply replace the Objects in one of the columns with:
    new Boolean(false)
    Read the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]How to Use Tables for more information.

  • Check a checkbox in a jtable in a panel from another panel

    I have a panel-> Panel A
    where I have some conditions and on that condition I want to check a checkbox in a jtable in another panel ->PanelB
    So Panel B has a jtable with one column as checkbox,I want to check/uncheck this checkbox based on some conditions in some other panel A
    I have no idea how to do this.Please help.
    Thanks

    885522 wrote:
    How will the change be reflected dynamically if the value changes in some other panel.By code that you write. If you want component X to change based on some changes to component Y, then first you set up a listener which will notify you when changes to component Y take place. In that listener you put code which makes the appropriate changes to component X, based on what happened to component Y.

  • Unable to uncheck hidden checkbox in RSA6

    Hi,
    I have to following problem: In datasource 0CO_OM_OPA_1 a field is marked as hidden but I am unable to uncheck the checkbox because the field is disabled (is gray so no action can be performed). Other fields in the datasource have their hidden checkboxes enabled. so it's this one field (AUTYP).
    Any idea how to enable the checkbox again because I need to add this field for extraction.

    Ok this seems to work now. Its not the kind of solution I prefer but it has done the job.
    UPDATE roosfield SET SELECTION = 'X' where OLTPSOURCE = '0CO_OM_OPA_1' AND FIELD = 'AUTYP'.

  • How to obtain checkbox checked/unchecked  while editing

    Hi All,
    My scenorio is,
    I have a form and on that form i have text field & checkbox.
    I am saving record by entering some value in text box & checking checkbox(if my checkbox checked then I am saving "Y" for that checkbox in DataBase).Its saving both things properly in databse.
    While editing , If i click on edit link , my text box value coming properly(i.e. value which I stored in databse. )
    But that checkbox is not coming in checked mode(i.e while saving I have checked checkbox)
    So how to obtain checkbox at the time of editing checked/unchecked as they were at the time of saving ?
    Thanks
    Sandip

    Hi,
    Thanks for your reply.
    Sorry my variable is userAdmin.
    I have getUserAdmin() method in the C.java(server side pojo )?
    But its return type is String.(return type String because I want to save "Y / N") while saving
    public class C{   // server side pojo
    private String userAdmin; // corresponding getter & setter
    lly, I have getUserAdmin() method in cleint side pojo
    public class B{ // client side pojo
    private boolean userAdmin; // corresponding getter & setter
    but while saving I am doing as,
    public class SaveClass
    public String saveMethod()
    C c = new C();
    B bb = new B();
    if (bb.getUserAdmin() == Boolean.TRUE)
    c.setUserAdmin("Y");
    else
    c.setUserAdmin("N");
    // in client side pojo userAdmin variable's return type is boolean for checking as,
    if (bb.getUserAdmin() == Boolean.TRUE)
    but on server side its String for saving "Y / N",
    if (bb.getUserAdmin() == Boolean.TRUE)
    aa.setUserAdmin("Y"); /// to save String here
    So if I write in JSP,
    <h:selectBooleanCheckbox value="#{BeanName.c.userAdmin}"/>
    its giving error as,
    javax.servlet.ServletException: Expected submitted value of type Boolean for Component : {Component-Path :.................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • My texts are being sent from icloud. I went to messages and uncheck all, but unable to check the phone number. can someone help?

    My friends tell me that my texts to them say they are coming from icloud.
    After reading how to fix it, I went to settings, messages, send and recieve and unclick everything
    but was unable to check/click off the phone number. I was able to check off my email. Am I doing something
    wrong?

    Hello Frankie Bagels,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/ht5538
    Unlink a phone number
    To remove a phone number from an Apple ID, sign out of FaceTime and Messages on your iPhone:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Have a nice day,
    Mario

  • Unable to check mark whole playlists to play since last update.  ONly allows me to check one at a time.  How do I fix?

    While in MY MUSIC on itunes, all my music is unchecked.  I can not check whole playlists by using the top checkmark to select all.  I went to all my playlists, same thing.  I can only press them ONE at a time, which will take about a day to check all of them. 
    any ideas?  anyone have same problem?  This just happened since last update.

    I exactly have the same problem as this "Unable to check mark whole playlists to play since last update.  ONly allows me to check one at a time.  How do I fix?" I have a windows7. Please help.

  • Error on Checking/Unchecking "Show"

    I an a designer getting ready to train my client in
    Contribute CS3. I have considerable experience with optional
    editable areas in DW templates and training clients in how to make
    items visible and not visible.
    However, in my current website I receive an error whenever I
    check or uncheck the Show box. (Also, I am using the MM_swapImage
    behavior in the top menu.)
    Format>Template Properties > either click or unclick
    the Show checkbox for an editable optional area, I receive this
    error message.
    While executing onLoad in Swap Image.htm, the following
    JavaScript error(s) occurred:
    At line 303 of file "C:\Program Files\Adobe]Adobe Contribute
    CS3\Configuration\Behaviors\Actions\Swap Image.js";
    TypeError: dw.getBehaviorTag is not a function
    I then have to press the OK button on the error message 5 or
    more times, the error message then disappears, and I am able to
    click the Publish button and it successfully publishes the page.
    How can I prevent this error message from appearing.
    Here's a page on the site I'm building.
    http://www.sivitzdesigns.com/about.php

    In "Swap Image.js" change line 303
    from: if (!dw.getBehaviorTag())
    to: if (dw.getBehaviorTag && (!dw.getBehaviorTag()
    and change line 306
    from: if (dw.getBehaviorElement()) selTag =
    dw.getBehaviorElement().tagName;
    to: if (dw.getBehaviorElement &&
    dw.getBehaviorElement()) selTag = dw.getBehaviorElement().tagName;
    You'll have to change it on your user's computer. It's a
    Contribute problem, not a Dreamweaver problem. The complete code
    snippet with before and after is:
    function initializeUI(){
    var niceNameSrcArray=new Array(), nameArray, i, selTag="";
    var imgSrcArray = new Array();
    var endsWithZero = /\[0\]$/; //ref ends with [0]
    //Determine if RESTORE is an option. If not, remove UI for
    it
    //the dw.getBehaviorTag() check ensures the checkbox
    //is not available if a behavior is attached to a timeline
    var removeCheckbox = false;
    //david, this was: if (!dw.getBehaviorTag())
    if (dw.getBehaviorTag && (!dw.getBehaviorTag() ))
    //if behavior is in a timeline
    removeCheckbox = true;
    else {
    //david, this was: if (dw.getBehaviorElement()) selTag =
    dw.getBehaviorElement().tagName;
    if (dw.getBehaviorElement &&
    dw.getBehaviorElement()) selTag = dw.getBehaviorElement().tagName;
    and then the rest of the function.

  • Using Javascript To UnCheck A Checkbox

    Hi,
    I have a select list with two options in. When one of them is selected I have two checkboxes that I want hiding and setting to unselected. I can hide and show them fine using *$x_HideItemRow* and *$x_ShowItemRow*, but when I hide them I want the setting as unselected.
    Have tried using html_GetElement(pThat).checked = false; but when the items are displayed again they are still displayed as selected.
    Can anyone show me how to uncheck a checkbox using javascript?
    Cheers
    Simon

    Simon,
    Use firebug in firefox to see what's happening. The name of your item is applied to an HTML fieldset element that contains the actual inputs of type checkbox. Each of those has a name based on the item name with "_X" on the end as in PXX_ITEM_NAME_0.
    You'll need to select the one you want to check/uncheck directly by adding the underscore and the number. Also, you can use $x over html_GetElement (just shorter).
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Check whether the checkbox in a form is checked or not using javascript

    when we click a check box (TBD) it should set the value of a field to a default value '1234'. If we uncheck the checkbox, it should set the field as Null.
    I have defined the checkbox as STATIC2:;1234 in form.
    I used the onClick event on the checkbox and called a function to update the column.
    Inside the function i am checking whether the check box is checked using
    if (document.getElementById('P4_TBD').checked=true)
    document.getElementById('P4_COL1).value='1234';
    else
    document.getElementById('P4_COL1).value=''; /* or $s("P4_COL1", "");
    it works only when check box is checked. If check box is unchecked it is not setting the field as Null.
    I checked document.getElementById('P4_TBD').checked=false instead of else clause. it is not working.
    Please help me on this issue.
    Thanks,
    Ravi

    When you are using checkboxes or option button, the ID for your button is using an index. If you create a group of 3 checkboxes with the ID = "MY_CHECKBOXES", APEX will create the following IDs for each of your options : MY_CHECKBOXES_0, MY_CHECKBOXES_1 and MY_CHECKBOXES_2. If you want to test if the first checkboxe is checked, you'll use document.getElementById('MY_CHECKBOXES_0').checked.
    I didn't test for a lone checkbox, but I expect your checkbox to be "TDB_0" not "TDB" who is the frame around your checkbox group.

  • Uncheck a Checkbox when Select List Clicked

    version 4.0.2.00.06
    Hello,
    Jari helped me with a javascript function to select all options in a multi-select list when a checkbox is checked by the user.
    A bug was reported that after clicking the checkbox to select all the options in the list, if the user then clicks on a single value in the select list the checkbox is still checked.
    Would someone help me with how to uncheck the checkbox when a single value is selected in the select list after the checkbox is checked to select all of the options in the select list?
    If you need more information please let me know.
    Thanks,
    Joe

    Hi,
    Same sample as in this post
    Re: The requested URL /apex/wwv_flow.accept was not found on this server
    I did add page JavaScript
    function checkSelected(pThis,pChk,pVal){
    var self=$($x(pThis));
    var o=self.find("option");
    var s=self.find("option:selected");
    if(s.length==o.length){
      $s(pChk,pVal);
    }else{
      $s(pChk,"");
    }And to P65_EMP multiu select HTML Form Element Attributes
    onchange="checkSelected(this,'P67_SELECT_ALL','ALL')"Regards,
    Jari

Maybe you are looking for

  • 3D Transform does not now work on elements 10. Why?

    When accessing the 3D Transform and selecting the shape required and OK.  The shape does not download to a blank page.  Also the anchor points, pan camera tool and trackball tool are all greyed out.  All these features worked a few months ago.  What

  • Photo I set as desktop comes out too zoomed in

    Hello, When I try to set a a photo as my desk top image it comes out very zoomed in...quite beyond merely fitting to screen. Is it something to do with my wide screen? It even does this with 16:9 photos. Thanks for any help in advance. W

  • Tabular form with select list not updating

    I have created a tabular form with a dynamic select list select primary_key, column1, htmldb_item.select_list_from_query(10,column2, 'select descr d, column_value r from lookup_table where column_value = '||column1) column2 from main_table The select

  • System copy PRD-- TST (ERP2004) and system source in BW

    Hi, we have landscape for ERP2004 DEV-TST-PRD and made system copy PRD on TST. Also landscape for BW+EP, systems BWD-BWP, and source systems TST/PRD are connected to BWD/BWP. After copy (according to manual, did by consultant) on BWD we have problems

  • Runtime Error when trying to connect with Media manager

    Whenever I try to connect to the Media manager with Blackberry Desktop manager, I get "Runtime Error"! It says: "Program:C:\Program Files\Roxio\MediaManager 9\MediaManager9.exe"  Then it says "This application has requested the Runtime to termnate it