Problem with checkbox item renderer in datagrid

I have a data grid having check box as an item renderer. I have viewed many posts in this forum but nothing useful in my case. I am failed to bind my datagrid itemrenderer checkbox with the field of dataprovider i.e. listUnitMovement.CHECK_PATH. Then I have to traverse data provider to check which checkboxes are checked.
[Bindable]
var listUnitMovement:XMLList=null;                      
In a function call
public function init(event:ResultEvent):void
    listUnitMovement=event.result.unitmovement;
     <mx:DataGrid id="dg_country"
                           dataProvider="{listUnitMovement}"
                              enabled="true">
                            <mx:columns>
                               <mx:DataGridColumn>
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:CheckBox selectedField="CHECK_PATH"  />
                                        </mx:Component>                                       
                                    </mx:itemRenderer>
                                </mx:DataGridColumn>
                                <mx:DataGridColumn headerText="Latitude" dataField="NEW_LAT" visible="false"/>
                                <mx:DataGridColumn headerText="Longitude" dataField="NEW_LONG" visible="false"/>
                               <mx:DataGridColumn>
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:Button label="Details"/>
                                        </mx:Component>                                       
                                    </mx:itemRenderer>
                                </mx:DataGridColumn>
                            </mx:columns>
                        </mx:DataGrid>

Hi,
Do you want to just check/uncheck the checkboxes based on the CHECK_PATH field.
Do you want something like this...
<?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Script>
<![CDATA[
 import mx.collections.ArrayCollection;[
Bindable] 
private var listUnitMovement:ArrayCollection = new ArrayCollection([{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:true,NEW_LAT:109.233,NEW_LONG:232.22},{CHECK_PATH:false,NEW_LAT:133.233,NEW_LONG:702.22}]);]]>
</mx:Script>
 <mx:DataGrid dataProvider="{listUnitMovement}">
 <mx:columns>
 <mx:DataGridColumn>
 <mx:itemRenderer>
 <mx:Component>
 <mx:CheckBox selectedField="CHECK_PATH" change="data.CHECK_PATH=selected" />
 </mx:Component>  
</mx:itemRenderer>
 </mx:DataGridColumn>
 <mx:DataGridColumn dataField="NEW_LAT"/>
 <mx:DataGridColumn dataField="NEW_LONG"/>
 </mx:columns>
 </mx:DataGrid>
</mx:Application>
Please let me know clearly what's your problem...Do you want to just bind the check box based on XmlList or something else..?
Thanks,
Bhasker Chari.S

Similar Messages

  • Problem with Checkbox ItemRenderer in a DataGrid

    Hello Everyone,
    I'm using a datagrid with two columns, which is used as a data entry grid. The first column has a simple text input field and the 2nd column has a checkbox as an itemrenderer. On creationComplete event, I'm passing an arraycollection as the dataprovider for this datagrid. The arraycollection:
    <mx:ArrayCollection id="psAC">
            <mx:source>
                <mx:Array>
                    <mx:Object PaText="line1" PaCheckbox="0" />
                    <mx:Object PaText="line2" PaCheckbox="0" />
                    <mx:Object PaText="line3" PaCheckbox="1" />
                    <mx:Object PaText="line4" PaCheckbox="0" />
                    <mx:Object PaText="line5" PaCheckbox="0" />
                </mx:Array>
            </mx:source>
        </mx:ArrayCollection>
    There is a datagrid (dGa) in the main application. On click of this, a pop up window comes up which has the same datagrid layout(i.e, 2 columns). And this is where the data is entered. Here, if the user checks the check box, I have assigned a value of '1' for the 2nd column of the arraycollection. THis code(below) works fine.
    <datagrid in pop up window>
    <mx:DataGridColumn headerText="Best Possible Action?" textAlign="center" width="200" editable="false">
                                <mx:itemRenderer>
                                    <mx:Component>
                                       <mx:CheckBox>
                                            <mx:Script>
                                                    <![CDATA[
                                                         override public function set data(value:Object):void{
                                                             if(value.PaCheckbox == 1){
                                                                this.selected = true;
                                                            }else{
                                                                this.selected = false;
                                                    ]]>
                                                </mx:Script>
                                            <!--<mx:change>
                                                <![CDATA[
                                                    if(this.selected == true){
                                                         data.PaCheckbox = 1;
                                                     }else{
                                                         data.PaCheckbox = 0;
                                                ]]>
                                            </mx:change>-->
                                        </mx:CheckBox>
                                    </mx:Component>
                                </mx:itemRenderer>
                            </mx:DataGridColumn>
    But I would also need to set the PaCheckbox value to 0 or 1, based on teh check condition of the check box. I tried using change event (commented in the code above). But there I get an error: Cannot access a property or method of a null object reference. I checekd in debug mode, there the data object is null! Can you please help me on how to pass back the values(0 o 1) to my arraycollection, based on the checkbox's status?
    Cheers,
    Deepak

    heyo,
    I solved it.....
    i was missing this line of code super.data = value; in the ovverriden function...Once we have this line, the data object will have teh field names and their values in it, which can be accessed on the change event...

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Accessing S:List Checkbox Item Renderer Outside the Renderer

    Hi All,
    I have an S:List, with a checkbox item renderer.  I was to be able to access the selected portion of the renderer to create a new function that at the press of a button this will delect all the current selected items in the list.
    Doco states that i should be able to do this just by setting the selectedIndex to -1.  But not sure if this is specific to 4.5??  But it is not working for me.
    Below is my current list.  Outside of this list flashbuilder does not know about chkList, or even selected.  How can i get access to this to deslect all?
    <s:List
    id="ltattributes">
    <s:itemRenderer>
    <fx:Component>
    <s:ItemRenderer>
    <fx:Script>
    <![CDATA[
    import mx.events.ItemClickEvent;
    protected function chkList_changeHandler(event:Event):void
    var e:ItemClickEvent = new ItemClickEvent(ItemClickEvent.ITEM_CLICK, true);
    data.selected = event.currentTarget.selected;
    e.item = data;
    e.index = itemIndex;
    dispatchEvent(e);
    ]]>
    </fx:Script>
    <s:CheckBox id="chkList" selected="false" label="{data.displayname}" change="chkList_changeHandler(event)"/>
    </s:ItemRenderer>
    </fx:Component>
    </s:itemRenderer>
    Thanks

    Try: dataGroup.getElementAt(). 
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Problem with checkbox group in row popin of table.

    In table row popin I have kept Check Box Group.I have mapped  the texts property of checkbox group to the attribute which is under the subnode of the table.the subnode properties singleton=false,selectioncardinality=0-n,and cardinality=0-n.
    if there are 'n' number of records in the table.each record will have its own row popin and in the row popin there is check box group.
    the check box group in the row popin  belongs to that perticular row.
    but the checkboxegroup values in row popins of all the  rows are getting changed to the row which is lead selected.
    The same scenario  (table in the row popin is showing the values corresponding to its perticular row and all the table values in popin are not getting changed to the one lead selected in the main table)is working fine with the table in place of  checkbox group in row popin with datasource property of table  binded to the subnode
    I cant trace out the problem with checkbox group in place of table.
    Please help me in this regard.I have to place check box group in place of table in row popin.
    Thanks and Regards
        Kiran Kumar K

    I have done the same thing successfully with normal check box ui element. Try using check box in your tabel cell editor instead of check box group.

  • Problem with checkbox column in matrix

    Hello.
    I have a little problem with checkbox column in matrix.
    Column is binded to the UserData.
    It has ValOn="Y", ValOff="N".
    I use C++. It is wird problem. In matrix I have 10 columns - scrollbar role and if You want see checkbox column, You must role to the right. If this column is on the screen, and I use:
    checkcell->PutChecked(VARIANT_TRUE);
    then the checkbox is cheched, and if the checkbox isn`t on the screen and I use this comment - it nothing happening.
    I tried to use ValOn="Y", PutChecked...
    The problem i solved if the column is on the screen - if the column is first in matrix or second, but if it`s last I have a big problem.
    My column with checkbox is not editable, but I tried to make it editable, check it, and then make it uneditable - the same efect.
    How can I solve it ?
    Sorry for my english.
    Kamil Wydra

    Hello Kamil,
    I am not sure about your problem, but here is an example of how to use checkbox in UI API.
    First, create the matrix with checkbox column in Screen painter, and the output is an xml file, like this. Type as 121 indicates that it is a check box.
    - <column AffectsFormMode="0" backcolor="-1" description="" disp_desc="0" editable="0" right_just="0" title="Rented" type="121" uid="Rented" val_off="N" val_on="Y" visible="1" width="41">
      <databind alias="U_RENTED" databound="1" table="@VIDS" />
      <ExtendedObject />
    Second, bind the column to table from DB. This is a bug of 2004 Screen Painter, so if you are using 2005 Screen Painter, there is no problem.
    Third, when you open the form, you can check and uncheck the cell.
    BTW, please set the editable of the column to true.
    Hope this helps,
    Nick

  • F-32 : Problem with Open Item selection

    Hi,
    We have a strange problem with open Item selection for customer clearing in t-code F-32
    In My QA system
    if I input spl GL indicator ="*" and uncheck Normal OI tick,
    the system selects all open items,
    (those with spl GL indicator and those without spl GL indicator)
    In My Dev system
    If I input spl GL indicator ="*" and uncheck Normal OI tick
    the system does not select any open items,
    Please let me know which setting controls this behaviour ?
    Regards
    Sachin

    Hello,
    Check your data in FBL5N for the option "Special GL Transactions". There could be that there is no data in the system with SPECIAL GL TRANSACTIONS.
    In F-32, there is no value like *
    You need to input right Special GL Indicator. "*" will not work here.
    I am sure in both the systems if you put "*" and UNTICK your normal transaction, you will NOT get any items to clear.
    Please DOUBLE CHECK whether you have unticked normal transaction.
    Regards,
    Ravi

  • InDesign refuses to update via Creative Cloud - each attempt fails within 30 seconds - no problem with other items - any suggestions?

    InDesign refuses to update via Creative Cloud - each attempt fails within 30 seconds - no problem with other items - any suggestions?

    What is the error message you receive?
    There is a manual way to do updates - All Adobe updates start here and select product, read to see if you need to install updates in number order, or if the updates are cumulative for the individual product http://www.adobe.com/downloads/updates/

  • Item renderer in datagrid with actionscript

    Hi
    I want to implement a datagrid similar to the one given int
    the starting flex examples but in actionscript. I am having a
    problem with the itemRenderer. I can't figure it out how I cam
    create a imagerender in a datagridcolumn.
    My code is:
    var dataG:DataGrid = new DataGrid();
    dataG.dataProvider = xmlList;
    var coluna:DataGridColumn = new DataGridColumn();
    coluna.dataField="nome";
    coluna.headerText="Title";
    var coluna2:DataGridColumn = new DataGridColumn();
    coluna2.dataField="thumbnail";
    coluna2.headerText="Title";
    var imagem:Image = new Image();
    imagem.height = 75;
    imagem.source = "../tb/"+instrumentos.thumbnail+".jpg";
    //HERE RELIES MY PROBLEM -HOW TO ASSOCIATE AN IMAGE TO THE
    ITEM RENDERER
    coluna2.itemRenderer = new ClassFactory(imagem);
    var lalala:Array = new Array();
    lalala.push(coluna);
    lalala.push(coluna2);
    dataG.columns = lalala;
    thanks in advance

    "jahh_drum" <[email protected]> wrote in
    message
    news:ghcs5u$p2d$[email protected]..
    > Hi
    >
    > I want to implement a datagrid similar to the one given
    int the starting
    > flex
    > examples but in actionscript. I am having a problem with
    the itemRenderer.
    > I
    > can't figure it out how I cam create a imagerender in a
    datagridcolumn.
    >
    > My code is:
    >
    > var dataG:DataGrid = new DataGrid();
    > dataG.dataProvider = xmlList;
    >
    > var coluna:DataGridColumn = new DataGridColumn();
    > coluna.dataField="nome";
    > coluna.headerText="Title";
    >
    > var coluna2:DataGridColumn = new DataGridColumn();
    > coluna2.dataField="thumbnail";
    > coluna2.headerText="Title";
    >
    >
    > var imagem:Image = new Image();
    > imagem.height = 75;
    > imagem.source = "../tb/"+instrumentos.thumbnail+".jpg";
    >
    > //HERE RELIES MY PROBLEM -HOW TO ASSOCIATE AN IMAGE TO
    THE ITEM
    > RENDERER
    > coluna2.itemRenderer = new ClassFactory(imagem);
    >
    > var lalala:Array = new Array();
    > lalala.push(coluna);
    > lalala.push(coluna2);
    >
    > dataG.columns = lalala;
    ClassFactory takes a class, not an instance.
    Try something like:
    foo:ClassFactory = new ClassFactory(Image)
    foo.properties= {height=75,
    source:"../tb/"+instrumentos.thumbnail+".jpg"};
    coluna2.itemRenderer = foo;
    Note that using a ClassFactory this way will give you the
    same image in
    every renderer to start out with. However, I believe that
    image
    itemRenderers by default will take their source from the data
    property when
    that gets set.
    HTH;
    Amy

  • Checkbox item renderer populated with data from 2 sources

    I have a list object that has a check box and a label (using an inline item renderer).  The list itself is populated with an array of objects and whether the checkbox is selected takes those objects and adds them to another list (for outbound purposes).  Since the selected list can change elsewhere in my app how do I keep the binding of selections consistent?  The dataprovider for my checkbox list is the first array of objects and is binded, but the second one (selected array) is not.  What would be the best way to provide that binding to make sure the selected is consistent when the second array changes.  Some of the code is below to better show...
    <cms:HilightList
         id = "distributorList"
         width = "100%"
         height = "100%"
         drawHighlight="{ViewUtils.drawHighlightIndicator}"
         drawSelection="{ViewUtils.drawHighlightIndicator}"
         dataProvider="{pmDistributors.distributors}">
         <mx:itemRenderer>
              <mx:Component>
                   <mx:HBox>
                        <mx:CheckBox
                                           selected = "{outerDocument.isSelected(data)}"
                               change = "{outerDocument.handleSelectedChange(event)}"/>
                        <mx:Label text="{data.name}"/>
                   </mx:HBox>
              </mx:Component>
         </mx:itemRenderer>
    </cms:HilightList>
    public function isSelected(item:Object):Boolean
         var partner:Partner = item as Partner;
         var selected:Boolean = false;
         for each(var schedPartner:Partner in scheduleAssets.partners)
              if(schedPartner.id == partner.id)
                   selected = true;
         return selected;
    public function handleSelectedChange(event:Event):void
         var partner:Partner = event.currentTarget.parent.data as Partner;
              if(event.currentTarget.selected)
                   addPartnerEvent(partner);
              } else {
                   removePartnerEvent(partner);

    Hi Aakcse,
    In this condition, you need to make use of both the Precedence Constraint between Control Flow Tasks and the Conditional Split Transformation. Supposing you get the value in the flat file and store it in a variable via Script Task, you can create two Data
    Flow Tasks, and connect the Script Task to the two DFTs.
    For the Precedence Constraint between the Script Task and the Data Flow Task 1, set the “Expression and Constraint” expression to @[User::vEntryStatus]=="Y". And for the Precedence Constraint between the Script Task and the Data Flow Task 2, set the “Expression
    and Constraint” expression to @[User::vEntryStatus]=="N".
    In Data Flow Task 1, add a Conditional Split Transformation with this expression [Entry]==”YES”, and direct this output to the destination component. In Data Flow Task 2, also add a Conditional Split Transformation with expression [Entry]==”NO”, and direct
    the output to the destination component.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click here
    Mike Yin
    TechNet Community Support

  • Problem with checkboxes in IR report mainly for update process please help

    Hello,
    Can anyone please help me out with this issue.
    I have an interactive report with 3 checkbox item for a single column named status. Based on the value of the column status the check box should be checked. For example:
    DECODE(status,'DEV',1,0) as DEV,
    DECODE(status,'RVW',1,0) as RVW,
    DECODE(status,'PRD',1,0) as PROD,
    So for this I have used the apex_item.checkbox item. Below is my report query
    SELECT APEX_ITEM.HIDDEN(30,0,'','f30_' || ROWNUM)
         || APEX_ITEM.HIDDEN(31,0,'','f31_' || ROWNUM)
            || APEX_ITEM.HIDDEN(01,ROWNUM,'','f01_' || ROWNUM)
         || APEX_ITEM.HIDDEN(04,CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN,'','f04_' || ROWNUM)
            || APEX_ITEM.HIDDEN(05,CHF_STATUS,'','f05_' || ROWNUM)
         || APEX_ITEM.HIDDEN(06,CHF_STATUS,'','f06_' || ROWNUM)
            || APEX_ITEM.HIDDEN(08,CHF_STATUS,'','f08_' || ROWNUM)
         || APEX_ITEM.HIDDEN(09,CHF_STATUS,'','f09_' || ROWNUM)
            || APEX_ITEM.HIDDEN(11,CHF_STATUS,'','f11_' || ROWNUM)
         || APEX_ITEM.HIDDEN(12,CHF_STATUS,'','f12_' || ROWNUM)
            || APEX_ITEM.CHECKBOX (32,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f30'');"'
         ,DECODE (0,1, ROWNUM),':','f32_' || ROWNUM) DELETE
            ,CHF_COLUMN
            ,CHF_STATUS
            ,APEX_ITEM.CHECKBOX (07,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f05'');"',DECODE (CHF_STATUS,'DEV',ROWNUM),':','f07_' || ROWNUM) 
              DEV_EDIT
         ,APEX_ITEM.CHECKBOX (10,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f08'');"',DECODE (CHF_STATUS,'RVW',ROWNUM),':','f10_' || ROWNUM) 
              RVW_EDIT
            ,APEX_ITEM.CHECKBOX (13,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f11'');"',DECODE (CHF_STATUS,'PRD',ROWNUM),':','f13_' || ROWNUM) 
              PRD_EDIT
            FROM CHF_COLUMN WHERE
    CHF_DATASTORE  = 'DOMAIN_DEV' AND
    CHF_SCHEMA     = 'SCHEMA_DEV' AND
    CHF_TABLE      = 'EMPLOYEEE'
    ORDER BY 1;  And I have a button for the update process so that the users can check the checkboxes option for the status column either 'DEV', 'RVW', 'PRD'. The status of the column can be in either of these states or can be null.
    I have a update process, its having some problem - I don't understand whats causing the problem. Below is the error message which I encountered when trying to update.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    My Update process.
    DECLARE
    l_cnt BINARY_INTEGER := 0;
    l_stepid number := 10;
    l_date DATE := SYSDATE;
    BEGIN
    FOR i IN 1 .. apex_application.g_f01.COUNT
    LOOP
    IF APEX_APPLICATION.G_f05 (i)  = 1 THEN
          UPDATE  CHF_COLUMN
               SET      CHF_STATUS = 'DEV'
             WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
              l_cnt := l_cnt + SQL%ROWCOUNT;
    apex_application.g_print_success_message := apex_application.g_print_success_message ||
    'Successfully updated'||l_cnt ||'<br><br>';
    END IF;
    IF APEX_APPLICATION.G_f08 (i)  = 1 THEN
          UPDATE  CHF_COLUMN
               SET      CHF_STATUS = 'RVW'
             WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
              l_cnt := l_cnt + SQL%ROWCOUNT;
    apex_application.g_print_success_message := apex_application.g_print_success_message ||
    'Successfully updated'||l_cnt ||'<br><br>';
    END IF;
    IF APEX_APPLICATION.G_f11 (i)  = 1 THEN
          UPDATE  CHF_COLUMN
               SET      CHF_STATUS = 'PRD'
             WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
              l_cnt := l_cnt + SQL%ROWCOUNT;
    apex_application.g_print_success_message := apex_application.g_print_success_message ||
    'Successfully updated'||l_cnt ||'<br><br>';
    END IF;
    END LOOP;
    COMMIT;
    END;If you can please have a look at the app, you can get a better understanding of my problem.
    Workspace : orton_workspace
    username : [email protected]
    password : sanadear
    Application No: 15089 SAMPLE_CHECKBOX_APP
    Thanks,
    Orton
    Edited by: orton607 on Aug 4, 2010 9:28 AM

    I could be wrong but maybe change the hidden items to be like:
    APEX_ITEM.HIDDEN(05,DECODE(CHF_STATUS,'DEV',1,0),'','f05_' || ROWNUM)
    APEX_ITEM.HIDDEN(08,DECODE(CHF_STATUS,'RVW',1,0),,'','f08_' || ROWNUM)
    APEX_ITEM.HIDDEN(11,DECODE(CHF_STATUS,'PRD',1,0),,'','f11_' || ROWNUM)so that the values are 0/1?
    Also, you have
    DECODE (CHF_STATUS,'DEV',ROWNUM)instead of
    DECODE (CHF_STATUS,'DEV',0,1)in the checkboxes, as I would expect.
    I'm also not sure why you need to duplicate the checkboxes (f07,f10,f13) as hidden items (f05, f08, f11) if they are both 0/1 values.

  • Problem with Checkbox in JTable

    This table here displays data from my MS Access database. It has 3 columns. Also I added the 4th column where this column contains checkboxes where I can select any row from the table. The checkboxes won't show except this "javax.swing.JCheckBox[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1571886,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=2,bottom=2,right=2],paintBorder=false,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=]". I have no problem displaying the table. Here's my coding.
    public Contact() {
    super(new GridLayout(1,0));
    Vector heading = new Vector();
              heading.addElement("Name");
              heading.addElement("Contact number");
              heading.addElement("Detail");
              heading.addElement(new JCheckBox(););
              Vector data = new Vector();
    try
    // Load the Database Driver Class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Driver loaded successfully.");
    // Establish a connection with parameter values for
    // database connection URL, username, password
    Connection con =
    DriverManager.getConnection("jdbc:odbc:db1","","");
    System.out.println("Connection established successfully.");
    try
    // Create a statement
    Statement stmt = con.createStatement();
    System.out.println("Statement created successfully.");
    String sql = "SELECT * FROM Contact";
    String[] columnNames = {"Name", "Contact Number", "Detail"};
    ResultSet rs = stmt.executeQuery(sql);
    System.out.println("SQL Query executed successfully.");
    System.out.println("Output the data from the result set");
    while (rs.next())
    Vector row = new Vector();
    row.addElement(rs.getString("Name"));
    row.addElement(rs.getString("Contact number"));
    row.addElement(rs.getString("Detail"));
    row.addElement(new JCheckBox());
    data.addElement(row);
    System.out.println("Output Completed.");
              rs.close();
    stmt.close();
    finally
    con.close();
    catch (Exception e)
    e.printStackTrace();
    final JTable table = new JTable(data, heading);
    table.setPreferredScrollableViewportSize(new Dimension(500, 500));
    table.setFillsViewportHeight(true);
    JScrollPane scrollPane = new JScrollPane(table);
    add(scrollPane);
    Where have I gone wrong? Please help.

    First of all:
    a) Don't forget to use the "Code Formatting Tags", so the posted code retains its original formatting.
    http://forum.java.sun.com/help.jspa?sec=formatting
    b) In the future, Swing related questions should be posted in the Swing forum.
    Now for the answer to your question, read the JTable API. You will find a link to the Swing tutorial on "How to Use Tables" which shows you the proper way to display Boolean data with a JCheckBox renderer.

  • Data provider problem in custom item renderer

    I have a complex, custom item renderer for a list. I add
    items that I extracted from an xml to the data provider using the
    IList interface. But when displaying the list, the items are all
    screwed up. Each rendered item has some parts which are initialized
    as different components depending on the values from the xml. This
    initialization is called in the item renderer for the
    creationComplete event.
    The weird thing is that when I output the dataProvider to
    check its values, some of the items have internal uids sometimes
    and sometimes they don't. If I output the dataProvider right after
    I add the items to it, none of them get internal uids. But from the
    initialize method, some of them do and some don't.
    To make things weirder, sometimes, as I scroll up and down
    the list, the dynamic components get all switched up. I'm either
    having a problem with internal uids or with the creation policies
    for lists. Or it's probably some simpler mistake I have yet to see.
    Anyone have any idea where the problem could lie? Any help is
    greatly appreciated.

    Any successful render must:
    1) override the set data property of the component
    Further, best practice is to store any data you need in the
    override set data(), and call invalidateProperties(). Then do the
    actual work in an override commitProperties() function.
    The framework is smart about when to call commitProperties
    efficiently. set data() gets called much more often.
    Tracy

  • Item Renderer for DataGrid

    I have a button component as a Item renderer in the column of
    the datagrid .
    I am not able to access the Itemrenderer component(which I
    declared in other mxml file in the datagrid)
    This is the data grid where I have the Itemrenderer:
    <mx:DataGrid id="dgCondition1"
    variableRowHeight="true" width="100%" height="150"
    verticalScrollPolicy="auto" editable="true"
    dataProvider="{initDataGrid_Create}" >
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="conditi"
    />
    <mx:DataGridColumn headerText="Condition"
    dataField="syntax" width="300" />
    <mx:DataGridColumn headerText="1" dataField="value"
    width="80" editable="false" itemRenderer="buttonRenderer"/>
    <mx:DataGridColumn dataField="value" headerText="2"
    itemRenderer="buttonRenderer" />
    I created a new mxml component for this button component
    .(buttonRenderer.mxml)
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="400" height="300">
    <mx:Script source="..TableDataGridBtn.as" />
    <mx:Button id="col1" label="" width="75"
    click="getDetail(event,col1)" />
    </mx:VBox>
    The Problem is I am not able to access the buttonRenderer in
    the datagrid itemRenderer tag .
    It says "Access of Undefined Property buttonRenderer".

    "nash99" <[email protected]> wrote in
    message
    news:g7alc5$nkd$[email protected]..
    > So
    > Is it that I can Use this ItemRenderer tag in the
    Application Tags only
    > Is there any other way I can use them in mxml components
    because I am
    > using
    > the same button in 16 datagrid columns , I dont wan't to
    make the code
    > look
    > redundant.
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=intro_3.html

  • Inbuilt Item Rendering inside DataGrid .

    Hi ,
    Please find the screen shot attached with this Thread .
    The data is been populated into the Datagrid from DataBase using ArrayCollection as DataProvider .
    Now i want to have Radio Buttons displayed at the begning of the each row of Names Column .
    When i tried to use , inbuilt itemRenderer as mx.controls.RadioButton ,  inside DataGridColumn  of 'Names' Column of DataGrid   , the Data appeared in such a way that all the Data inside the Names Column is repalced by showing only RadioButtons .
    Please tell me if this is possible using Inbuilt Item Rendering itself??(As Custom Rendering seems tough for me rigjt now )
    Or suggest me an easy approach , basically my requirement  is that i want to get the Selected Value Object into a function for doing Upadate and Delete facility .
    Please help
    Thanks in advance .

    Thanks for the reply , sorry for th
    late reply as i dont have Flex at my Work place .
    This is my code :
                <mx:DataGrid  id="MyDG" height="100%" width="100%"
                     dataProvider="{flightList}" change="GetTheValue()">
                <mx:columns>
                    <mx:DataGridColumn headerText="Names" dataField="uname">
            <mx:itemRenderer>
    mx.controls.RadioButton
    </mx:itemRenderer>
                    </mx:DataGridColumn>
    <mx:DataGridColumn headerText="Pwds" dataField="pass" >
                    </mx:DataGridColumn>
                </mx:columns>
                            </mx:DataGrid>
    This is the screen shot earlier and now afeter adding Item Rendering , Any help .
    Please find the screen shots attached

Maybe you are looking for

  • Macbook pro retina and time capsule problem

    I have purchased a macbook pro retina and time capsule recently. I had no trouble setting up the TC, however even though it is visible in the Finder, I can not connect to it. I can not make time machine. Try to connect with my imac that has snow leop

  • Please wait while windows re-configures iTunes ....

    This is the sort of box on the XP desktop that will strike fear into your heart, especially the day after Patch Tuesday. It doesn't seem to have caused any problems but then I haven't really had time to check (And I don't use IE). If you're suddenly

  • IOS5 podcast tracks in an episode

    I am subscribed to several podcasts that DJs put in tracks from different artists, and i used to be able to see the name of the track and its artist in each segments in each episode of the podcast, After upgrading my iPad to iOS5, I can only see the

  • Where i can find list of bdc command  ?

    where i can find list of bdc command  ? i need to analys batch session ( sm35)  , and i need to find what the command do  ( like :  "z-" , "p+" , "omx"  , "bu" ...... )  . is there any list for it ( list of command )  ?

  • Auto forward specifig user / group to an url

    Hello, is it possible to forward a user after login to a url that is specific to the user / group / role? Thanks, Vanessa