Checkbox inside tableview

Hi Experts
Im designing a application in that i want to place a check box,
pls help how to create it
Thanks and Regards

Hi Arun,
Methd RENDR_CELL_START
case p_column_key.
when 'your field name' .
data: cbox type ref to cl_htmlb_checkbox .
create object cbox.
      cbox = cl_htmlb_checkbox=>factory( id = p_cell_id
                                         disabled = 'false'
                                         o n c l ick = 'cbox_event'
                                          text = 'your text' ).
      p_replacement_bee = checkbox.
endcase.
Regards,
Anubhav

Similar Messages

  • How to unSelect checkBoxes inside a buttonBar

    Hello!
    I've been a Flex developer for several months now and have made some great strides.  However, I've ran across a problem that requires some help from the Pros.
    I'm using Flash Builder 4.5 Premium.
    Scenerio:
    I have a buttonBar whose dataProvider is an mx:viewStack supplied by Spark NavigatorContent.  I have checkBoxes inside each of the NavigatorContent instances.  The checkBoxes turn content on and off.  Works great.
    Problem:
    When you select a different button in the buttonBar the selected content from the previuos button still displays.
    Question:
    How do I get the selected content from the previous button to not display? I'm not sure how to do this. 
    Bonus:
    If someone can tell me how to handle the checkBox eventHandler more efficiently that would be awesome!  Because right now I currently have an eventHandler function for each check box (like 18).  Since I'm still grean, so I figured I'd get everything working before trying to streamline this.  Or perhaps (I'm havina an epiphany) I need to add something to this code to unSelect the checkBox once the button has changed?  Not sure and confused. 
    Thanks for the help!
    Joe
    App Code:  If it's too much I appologize - I did leave out some.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:esri="http://www.esri.com/2008/ags"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   pageTitle="Aloha Existing Conditions"
                   initialize="initApp(event)">
        <fx:Style source="alohaExistingCond.css"/>
        <fx:Script>
            <![CDATA[
                import com.esri.ags.Graphic;
                import com.esri.ags.components.Editor;
                import com.esri.ags.components.Legend;
                import com.esri.ags.events.FeatureLayerEvent;
                import com.esri.ags.events.LayerEvent;
                import com.esri.ags.geometry.MapPoint;
                import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
                import com.esri.ags.layers.DynamicMapServiceLayer;
                import com.esri.ags.layers.TiledMapServiceLayer;
                import com.esri.ags.layers.supportClasses.LayerInfo;
                import com.esri.ags.layers.supportClasses.LayerLegendInfo;
                import com.esri.ags.layers.supportClasses.LegendItemInfo;
                import com.esri.ags.tasks.supportClasses.AddressCandidate;
                import flash.events.Event;
                import flashx.textLayout.events.UpdateCompleteEvent;
                import mx.containers.TitleWindow;
                import mx.controls.Alert;
                import mx.core.IFlexDisplayObject;
                import mx.events.FlexEvent;
                import mx.managers.PopUpManager;
                import mx.rpc.AsyncResponder;
                import spark.components.Panel;
                import spark.events.IndexChangeEvent;
                import splash1.SplashScreen1;
                public function initApp(event:FlexEvent):void
            //        showWindow();   
            //        viewMenu.addEventListener(IndexChangeEvent.CHANGING, bBarChangeHandler);
            //    public function bBarChangeHandler():void
                private var point1:Point = new Point();
                private function showWindow():void {
                    var login:SplashScreen1 = SplashScreen1(PopUpManager.createPopUp(this, SplashScreen1 , true));
                           PopUpManager.centerPopUp(login);
                public function turnonbasemap():void   
                    photo.visible = false;
                    basemap.visible = true;       
                public function turnonphoto():void
                    photo.visible = true;
                    basemap.visible = false;       
                public function bintBox(evt:MouseEvent):void
                    myLegend.visible = true;
                    if(CheckBox(evt.target).selected)
                    bikelaneMapServer.visible = true;
                else
                     bikelaneMapServer.visible = false;
                public function sintBox(evt:MouseEvent):void
                    sidewalkMapServer.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkMapServer.visible = false;   
                public function scomBox(evt:MouseEvent):void
                    sidewalkComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        sidewalkComments.visible = false;   
                public function bcomBox(evt:MouseEvent):void
                    bikelaneComments.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        bikelaneComments.visible = false;   
                public function opsBox(evt:MouseEvent):void
                    OPS.visible = true;
                    if(CheckBox(evt.target).selected)
                    else
                        OPS.visible = false;   
            ]]>   
        </fx:Script>
    <!-- Declaration are for Non-Visual Elements ~~~~~~~~~~~~~~~ -->
        <fx:Declarations>
            <esri:Locator id="locateTask"
                          url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_NA_10/GeocodeServer"/>
            <esri:SimpleMarkerSymbol id="mySymbol"
                                     alpha="0.5"
                                     color="0xFF0000"
                                     size="21"
                                     style="circle">
                <esri:SimpleLineSymbol width="2"/>
            </esri:SimpleMarkerSymbol>
        </fx:Declarations>
    <!-- Button Bar Window ~~~~~~~~~~~~~~~ -->
        <s:BorderContainer id="buttonBarContainer"
                           left="352" right="3" top="64" height="134"
                           borderWeight="2" cornerRadius="5">
            <s:Label text="Select an item below:"
                     x="10" y="10"/>
            <s:ButtonBar id="viewMenu" left="5" right="5" top="30" height="21"
                         dataProvider="{myViewStack}"
                         requireSelection="true"/>
                         <!-- change="changeSelection(event)" -->
                <s:Group id="layerGroup"
                         left="5" right="3" top="55" height="80">
                        <mx:ViewStack id="myViewStack" height="72">
                            <s:NavigatorContent id="planning" label="Planning">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="bCommentCheckBox" 
                                label="Bike Lane Comment"
                                fontSize="14"
                                click="bcomBox(event)"/>
                                <s:CheckBox id="foo1"
                                            label="Foo 1"
                                            fontSize="14"/>
                                <s:CheckBox id="foo2" 
                                            label="Foo 2"
                                            fontSize="14"/>
                                <s:CheckBox id="foo3"
                                            label="Foo 3"
                                            fontSize="14"/>
                                <s:CheckBox id="foo4" 
                                            label="Foo 4"
                                            fontSize="14"/>
                            </s:NavigatorContent>
    <!--  trans tab  ~~~~~~~~~~~~~~-->                   
                            <s:NavigatorContent id="trans" label="Transportation">
                                <s:layout>
                                    <s:TileLayout columnWidth="175" orientation="columns"
                                                  paddingLeft="10" paddingRight="20"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="sCommentCheckBox"
                                            label="Sidewalk Comments"
                                            fontSize="14"
                                            click="scomBox(event)"/>
                                <s:CheckBox id="sidewalkCheckBox"
                                            label="Sidewalk Inventory"
                                            fontSize="14"
                                            click="sintBox(event)"/>
                                <s:CheckBox id="bikelaneCheckBox" 
                                            label="Bike Lane Inventory"
                                            fontSize="14"
                                            click="bintBox(event)"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="environ" label="Environmental">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="200"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:CheckBox id="opsCheckBox" 
                                            label="Watershed Enhancement"
                                            fontSize="14"
                                            click="opsBox(event)"/>
                                <s:CheckBox id="foo5"
                                            label="Foo 5"
                                            fontSize="14"/>
                                <s:CheckBox id="foo6" 
                                            label="Foo 7"
                                            fontSize="14"/>
                                <s:CheckBox id="foo8"
                                            label="Foo 8"
                                            fontSize="14"/>
                                <s:CheckBox id="foo9" 
                                            label="Foo 9"
                                            fontSize="14"/>
                                <s:CheckBox id="foo10"
                                            label="Foo 10"
                                            fontSize="14"/>
                                <s:CheckBox id="foo11" 
                                            label="Foo 11"
                                            fontSize="14"/>
                                <s:CheckBox id="foo12"
                                            label="Foo 12"
                                            fontSize="14"/>
                                <s:CheckBox id="foo13" 
                                            label="Foo 13"
                                            fontSize="14"/>
                                <s:CheckBox id="foo14" 
                                            label="Foo 14"
                                            fontSize="14"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="housing" label="Housing/Social">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Housing and Social Services Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="built" label="Built Environment">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Built Environment Maps"/>
                            </s:NavigatorContent>
                            <s:NavigatorContent id="transit" label="Transit">
                                <s:layout>
                                    <s:TileLayout paddingLeft="10" paddingRight="20"
                                                  orientation="columns" columnWidth="175"
                                                  requestedColumnCount="-1"/>
                                </s:layout>
                                <s:Label text="Tansit Maps"/>
                            </s:NavigatorContent>
                        </mx:ViewStack>
                    <!--<s:Label id="selectionText"
                             x="10" y="60"/>  -->
                </s:Group>
        </s:BorderContainer>
    <!-- Legend Window ~~~~~~~~~~~~~~~ -->   
        <s:BorderContainer id="leContainer" left="3" top="140" bottom="3" width="347"
                           borderColor="#808080" borderWeight="2" cornerRadius="5" fontWeight="bold">
            <s:VGroup id="hGroup"
                      width="333"
                      height="500"
                      paddingBottom="11"
                      paddingLeft="5"
                      paddingRight="5"
                      paddingTop="10">
                <esri:Legend id="myLegend"
                             height="100%"
                             bottom="10"
                             width="330"
                             layers="{[ bikelaneMapServer, sidewalkMapServer, sidewalkComments, bikelaneComments, OPS ]}"
                             map="{myMap}"
                             respectCurrentMapScale="true"/>                 
            </s:VGroup>   
        </s:BorderContainer>   
    <!-- Map Window ~~~~~~~~~~~~~~~ -->       
        <s:BorderContainer id="mapBorder"
                           left="352" right="3" top="200" bottom="3"
                           borderColor="#808080"
                           borderWeight="2" cornerRadius="5">
            <esri:Map id="myMap" left="0" right="0" top="0" bottom="0" wrapAround180="true" logoVisible="false">
                <esri:extent>
                    <esri:Extent id="washco"
                                 xmin="7565269.4485383" ymin="657281.31999349" xmax="7607044.62214942" ymax="696603.368604601">   
                        <esri:SpatialReference wkid="2269"/>       
                    </esri:Extent>   
                </esri:extent>
                <esri:ArcGISTiledMapServiceLayer id="basemap"
                                                 url="http://......../Washco_primary_basemap_SP/MapServer"/>
                <esri:ArcGISTiledMapServiceLayer id="photo"
                                                 url="http://......../Orthos_2010_SP/MapServer"
                                                 visible="false"/>
                <esri:ArcGISDynamicMapServiceLayer id="bikelaneMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........DOE_Bikelane/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="sidewalkMapServer"
                                                   name=" "
                                                   visible="false"
                                                   url="http://......../DOE_Sidewalk/MapServer"/>
                <esri:ArcGISDynamicMapServiceLayer id="OPS"
                                                   name=" "
                                                   visible="false"
                                                   url="http://........Watershed_Enhance/MapServer"/>   
                <esri:FeatureLayer id="sidewalkComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://........./SidewalkComment/FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:FeatureLayer id="bikelaneComments"
                                   mode="snapshot"
                                   visible="false"
                                   url="http://......../FeatureServer/0"/>
                <!--
                outFields="[Comment, entered]"
                -->
                <esri:GraphicsLayer id="myGraphicsLayer"/>
            </esri:Map>
    </s:Application>

    Hi Kiran,
    U can use ItemRenderer to show button inside a cell of datagrid..!
    either inline ItemRenderer or external ItemRenderer as per your conveninent.
    sample:
    <mx:DataGrid>
    <mx:DataGridColumn headerText="Title" dataField="title">
                <mx:itemRenderer>
                    <mx:Component>
                            <mx:Button lable="Add" width="50" height="50"/>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
    </mx:DataGrid>
    Go Through this link : http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html
    Thanks,
    Pradeep

  • Link inside tableview iterator

    Hi Experts,
    I kept a link inside tableview iterator it is working fine, when i click the link it shows error, i cant understand it.
    The error is
    The following error text was processed in the system:
    BSP Exception: Das Objekt targetbspapplication/page.htm in der URL /sap(bD1lbiZjPTgwMA==)/bc/bsp/sap/ztableview1/targetbspapplication/page.htm?link=WWW.SDN.SAP.COM ist nicht gültig.
    please help me to solve it.
    Thanks & Regards,
    Arun

    Hi Arun,
    You can try the method mentioned below:
    RENDER_CELL_START
    when 'ACTION'.
            if p_edit_mode is not initial.
              data: bee_table  type ref to cl_bsp_bee_table,
                       link       type ref to cl_htmlb_link.
              data: cell_id_del(20).
              cell_id_del = p_cell_id.
              create object bee_table.
              link ?= cl_htmlb_link=>factory( id = p_cell_id
                                               text = 'Modify Entries'
                                               on cli ck = 'modify').
              bee_table->add( element = link level = 1 ).
              p_replacement_bee ?= bee_table.
            endif.
    OnInputprocessing of BSP page:
    when 'modify'.
          gv_flg_tv_popup = 'X' .
          gv_matcode = gs_materials-matnr.
    In Layout:
    <%
      if gv_flg_tv_popup is not initial.
            %>
            <s cript type='te xt/ jav ascript'>
            var m atcode="<%= gv_matcode %>";
            windo w.open('tv_popup.htm?ma tcode='+ma tcode+'&end','my window','width=450,height=230,res izable=no');
            </s cript>
            <%
      clear gv_flg_tv_popup.
            %>
            <%
      endif.
            %>
    In the above code , I have a tableView in which last  column is a link.On Click of this link a new window is opened in whicn details of one material is displayed in tableview.on click of link OnInputprocessing is trigered and I read the row no for which link is clicked and the material numnber for that row.Now in OnCreate of popup window I fetch the data for that material and display it in the tableView.
    Regards,
    Anubhav

  • Work around for $fieldname$ replacement inside tableview

    Hello All,
    I hope you can help me on an issue I have. I've create a BSP but it doesn't work with any other browser except IE.
    So I changed the design to design2003  to work with other browsers but the $fieldname$ replacement inside tableview is not supported.
    In the eg. a user would click on 'B10' value in a cell of col. 5 row 1 as a link and this value of 'B10' would be pass as a parameter value to
    display contact information for B10. 
    How do I capture this value in the cell of the tableview to pass to another page for data selection??
    Much appreciation for any advise.

    Are you using Iterator? If not use iterator. It will allow you to do the way you wanted...
    Just go through Weblog:
    /people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
    /people/sap.user72/blog/2004/08/27/bsp-howto-tableview-iterator--column-header-graphics
    /people/thomas.jung3/blog/2005/07/18/bsp-extension-for-downloading-a-table-applying-an-iterator
    /people/sap.user72/blog/2005/05/05/bsphowto-filter-using-dropdown-in-tableview
    If you need any help, let me know..
    <i>*Reward each useful answer</i>
    Raja T

  • Automatic Marking of a row Checkbox in tableview MULTISELECT

    Dear all,
    We are using a tableview with iterator and selectedrow-table in MULTISELECTMODE . The tableview gives back the table of the selected rows which have to be processed .
    After a users action and a fired event we have to store possible changed data out of the tableview into a internal memory table ( Export/Import to INDX database ).
    Therefore the user has to mark all rows with changed data to prevent that we have to check all rows (max. 20000 )out of the tableview for differences between the data in the memeory table and the tableview ( performance !! )
    Is ther any possibility to mark the checkbox on the left border of the data row automatically ( by event ? ) if one of the editable inputfields is changed by the user ? Otherwise the user has to scroll up to 40 columns to the left only to mark the row for saving the changed data .
    It would be great to get a hint !! Thanks in advance .

    Hi Craig,
    Yes this is clear .
    We already use that pattern tabid_row_cell for the cell identification in a javascript function.
    But how can I adress to the automaticly in MULTISELECTMODE added checkbox ( or the PrevSelectedtable ) which is not part of my columndefinitions table ? What is the name of that field ?
    The background of our problem with rowmarking is the fact that all data of an internal table are lost in event OnInputProcessing if we fill that table ( 45 columns )for the first time in OnInitialization and not in OnCreate like in most of the mentioned examples ( for instance with table sflight ) .
    On the other hand the OnCreate event will be proceeded after every click event , no matter if we use a stateful or stateless mode . And we want to read the database table for filling the internal table only once if we proceed the OnInit for the first time . 
    We have to select the data out from a ODS table with searchcriteria ( 4 values of table-keys ) from a pre-called start page . And the validation of automatic page attributes in OnCreate seems to fail in general , so all the needed attributes are empty in OnCreate.
    That's why we have to refill the internal table ( from INDX database ) everytime we proceed the OnInitialization event ( also after a simple pageDown ), so data changes inside the tableview object would have been overwritten without storing changes into the memory area of the internal table . This is an unwished emergency exit but we don't know how to deal with this on a better and easier way .
    I tried to save the internal table as a hidden page attribute in OnLayout getting an conversion error after syntax check - this worked very well in other cases .
    If there is a way to get a persistant existing internal table ( during all events ) and the tableview hold it's data changes we could forbear from the rowmarking .
    Best regards and hope that you can help
    Dirk Läufer

  • Disable Checkbox in TableView

    Hi,
    I am using a HTMLB TableView to visualize data...in the first column of each row theres a Checkbox to select one or more rows... now I want to disable the Checkbox for some rows. Is it possible to achieve this with a custom CellRenderer ? My problem with this approach is, that the method TableView.getValue(...) delivers a String.... I had expected an object or component...in my case a CheckBox...  any suggestions ?
    Thanks in advance
    Oliver

    Hi Oliver,
    myTableView.setRowSelectable(i, false);
    Hope it helps
    Detlev

  • CheckBox inside DataGrid

    I create a data grid with check boxes inside the cells of a certain column named "CheckColumn".
    In the class that implements the ICellRenderer are the code:
    public class CheckCellClass extends CheckBox implements ICellRenderer {
         .... stufffs....
         .... stufffs....
         public function set data(d:Object):void {
                _data = d;
                _selected = _data["CheckColumn"];
                label = "";
    PROBLEM: This metod works, but this make necessary a new class for each column wich uses checkboxes, cause of the column name in the statement: _selected = _data["CheckColumn"];
    So, I need a workaround to the label in the object. In AS2 this was CellRenderer.getDataLabel() function what are the equivalent in AS3?

    Hi
    Have a look at this post
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=585&threadid=1364035&fo rumid=60
    David

  • Checkbox for TableView

    Hi all,
    I need to place a checkbox as a column in each line item of an item list. Was planning to making it to a value attribute as it has no underlying attribute to map to it. However, how do i retrieve whether the checkbox has been checked or not.
    Kindly share any links/blogs that explain more about placing checkboxes in IC.
    Thanks in advance.
    Nisha

    steps for creating the class.
    go to transaction SE24 enter a name and click create , and hit enter on the popup, then hit save in the next pop up (without changing any default values)
    now click on the interfaces tab and enter "IF_HTMLB_TABLEVIEW_ITERATOR" in interface column.
    now click on methods tab.
    place the cursor on IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method and click on the code button (third from left).
    in this place you can enter the code.
    for example if you want column name "ABC" as check box.
    CASE p_column_key.
        WHEN 'ABC'.
          DATA: li_checkbox    TYPE REF TO   cl_htmlb_checkbox.
          CREATE OBJECT li_checkbox.
          li_checkbox->id        = p_cell_id .
         li_checkbox->checked   = m_row_ref->invisible.
          p_replacement_bee      = li_checkbox.
    endcase .
    now in the oninitializationevent of your page enter the following code
    my_iterator should be declared in page attribute with type ref to IF_HTMLB_TABLEVIEW_ITERATOR
    CREATE OBJECT my_iterator TYPE <your iterator class> .
    and in the layout section.
    <htmlb:tableView id            = "tv1"
                               selectionMode = "NONE"
                               width         = "100%"
                               table         = "<%= itab %>"
                               iterator      = "<%= my_iterator %>" />
    this is all you need for the iterator to work for your case.
    Hope this is clear.
    Regards
    Raja

  • Putting Checkboxes inside a list

    ive downloaded this sample from
    http://blogs.adobe.com/aharui/
    and im tryin to use it in my course management application.
    im using amfphp 1.9
    i simply want the app to retrieve the list of courses
    available and populate a list which will the be used in a form so
    that a student can be enrolled onto a course by clicking on a
    checkbox. similar to the sample shown above.
    the courses table contains the following fields
    CourseID
    CourseName
    TeacherID
    below is a break down of my code hope it makes sense
    populating the array collection:
    courseList = new ArrayCollection (
    ArrayUtil.toArray(evt.result) );
    layout:
    <mx:Label x="21" y="290" text="Course"/>
    <mx:List id="list1" dataProvider="{courseList}"
    width="242" x="21" y="307" labelField="CourseName" height="138">
    </mx:List>
    my list currently shows all the courses from the courses
    table, however i want to attach a checkbox to each list.
    the list will be used in a form which allows the user to
    select what courses to enrol the student to. im not sure how to
    exactly
    so how can i get my check boxes to behave in the same way as
    the sample application shown on the links above?

    This works fine for me and I have no scrolling issues. My
    item renderer is copied below. The data property is a custom object
    that supports a _selected attribute.
    So to fill the list I create objects to populate the list and
    create any array collection. This then is the dataprovider for the
    list.
    To determine if an item is checked I iterate the collection
    and examine the selected attribute.
    Item rendererer
    <?xml version="1.0"?>
    <!-- itemRenderers\list\myComponents\RendererState.mxml
    -->
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="120" height="20">
    <mx:Script>
    <![CDATA[
    private function doSelection():void
    if(cb.selected == true)
    data.selected = true;
    else
    data.selected = false;
    ]]>
    </mx:Script>
    <!-- Define the Link control to open a URL. -->
    <mx:CheckBox id="cb" click="doSelection()"
    selected="{data.selected}" width="17"/>
    <mx:Label id="State" text="{data.label}" x="17" y="0"
    width="90"/>
    </mx:Canvas>

  • Nested Components - c.CheckBox inside a C.Table ?

    Can one nest components ?
    For e.g.  a c.Table has a row added to it  using addRow(). Now a c-component like c.CheckBox has to be added to a cell.

    Hi Varun,
    As far as i have explored, the nesting is not possible. You can add only text & image elements within the table component. However a workaround could be that u place images of check & uncheck instead. And flip them as in when clicked. Hope this is useful.
    regards,
    Kunal Kotak

  • Issue when clicking checkbox inside JTable

    The following exception in displayed when populating a table that is created extending the JTable, and clicking on the checkbox that is present in one of the cells. Any idea !!!!!!!!!!!!!
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.setValueIsAdjusting(BasicTableUI.java:480)
    at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mouseReleased(BasicTableUI.java:534)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
    at java.awt.Component.processMouseEvent(Component.java:5100)

    Post a small demo code that is generally compilable, runnable and could reproduce your problem. See: http://homepage1.nifty.com/algafield/sscce.html and http://www.yoda.arachsys.com/java/newsgroups.html

  • How to nest Checkbox inside Datacolumn

    Dear all,
    Usually we embed a checkbox in a list of row in table. How do
    I achieve this in Flex? Since in DataColumn I can not nest a
    Checkbox component. Any examples would be great.
    Thanks in advance.

    "thejavafreak" <[email protected]> wrote in
    message
    news:gf42mi$pcm$[email protected]..
    > Dear all,
    >
    > Usually we embed a checkbox in a list of row in table.
    How do I achieve
    > this
    > in Flex? Since in DataColumn I can not nest a Checkbox
    component. Any
    > examples
    > would be great.
    >
    > Thanks in advance.
    http://www.returnundefined.com/2006/11/creating-truly-reusable-renderers-with-classfactory

  • Checkbox inside jtable

    I have the following sample code in which i wanted to include checkbox in the 3rd column. How to insert?
    import java.awt.Dimension;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    public class simpletable extends JPanel
         public simpletable()
              String[] columnNames={"FName","LName","Vegetarian"};
              Object[][] datas={ {"Harry","Potter",new Boolean(true)},{"William","Shakespeare",new Boolean(true)}};
              final JTable table=new JTable(datas, columnNames);
              table.setPreferredScrollableViewportSize(new Dimension(400, 50));
              JScrollPane scrollPane = new JScrollPane(table);
              add(scrollPane);
              int numRows = table.getRowCount();
              int numCols = table.getColumnCount();
              javax.swing.table.TableModel model = table.getModel();
              System.out.println("Value of data: ");
              for (int i = 0; i < numRows; i++)
              System.out.print(" row " + i + ":");
              for (int j = 0; j < numCols; j++)
              System.out.print(" " + model.getValueAt(i, j));
                   private static void createAndShowGUI()
                   JFrame.setDefaultLookAndFeelDecorated(true);
                   JFrame frame = new JFrame("SimpleTableDemo");
                   frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                   simpletable newContentPane = new simpletable();
                   newContentPane.setOpaque(true); // content panes must be opaque
                   frame.setContentPane(newContentPane);
                   frame.pack();
                   frame.setVisible(true);
              public static void main(String[] args)
              javax.swing.SwingUtilities.invokeLater(new Runnable()
                        public void run()
                             createAndShowGUI();
    }

    Hi,
    If u want to place a check box in a table u need to place the rederer and editor of the check box.
    pls find the editor and redorer for the check box.
    public class CheckBoxCellEditor extends JCheckBox implements TableCellEditor {
    protected ChangeEvent changeEvent = new ChangeEvent(this);
    protected EventListenerList listenerList = new EventListenerList();
    boolean selected = false;
    boolean cellEnabled = true;
    * Constructs a new <code>CheckBoxCellEditor</code> object.
    public CheckBoxCellEditor() {
    super();
    this.setSize(10, 10);
    addItemListener(new ItemListener() {
    * Invoked when item event occurs.
    * @param event <code> ItemEvent</code>
    public void itemStateChanged(ItemEvent event) {
    fireEditingStopped();
    * Registers the <code>CellEditorListener</code> to listeners list
    * @param l a <code>CellEditorListener</code>
    public void addCellEditorListener(CellEditorListener l) {
    listenerList.add(CellEditorListener.class, l);
    * To cancel the Cell Editing invoked all the actions with this cell will be cancelled
    public void cancelCellEditing() {
    fireEditingCanceled();
    * Returns the cell editor value as <code>Object</code> this will be called when stops the
    * cell editing
    * @return Object
    public Object getCellEditorValue() {
    return new Boolean(this.isSelected());
    * Returns the Editor Component to be painted on the table for the given row and column with
    * given value.
    * <p>
    * in the method we need to set the value and state of component then return component itself so
    * that it can be painted as it is on the table.
    * @param table <code>JTable</code> is the component where this editor need to be painted.
    * @param value <code>Object</code> is the value for the EditorComponent.
    * @param isSelected boolean
    * @param row int
    * @param column int
    * @return <code>Component</code> is the editor component to be painted on the table.
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
    int row, int column) {
    selected = isSelected;
    this.requestFocus();
    if (table.isCellEditable(row, column)) {
    this.setEnabled(true);
    else {
    this.setEnabled(false);
    if (value.equals(new Boolean(true))) {
    this.setSelected(true);
    else {
    this.setSelected(false);
    return this;
    * sets the state of the cell.
    * @param enabled boolean
    public void setCellEnabled(boolean enabled) {
    cellEnabled = enabled;
    * Determines whether this editor component is Editable or not if the return value is true then
    * it will behave as editable component other wise it can not allow to edit
    * @param anEvent <code>EventObject</code>
    * @return boolean
    public boolean isCellEditable(EventObject anEvent) {
    return cellEnabled;
    * Remove the <code>CellEditorListener</code> from the listeners list.
    * @param l <code>CellEditorListener</code>
    public void removeCellEditorListener(CellEditorListener l) {
    listenerList.remove(CellEditorListener.class, l);
    * Returns whether cell should be selectble or not when some event occurs.
    * @param anEvent <code>EventObject</code>
    * @return boolean
    public boolean shouldSelectCell(EventObject anEvent) {
    return true;
    * Stops the cell Editing invoked when the focus lost from this editorcomponent and puts the
    * values into model
    * @return boolean
    public boolean stopCellEditing() {
    fireEditingStopped();
    return true;
    * Invoked when stops the cell editing by removing thefocus from the editor component.
    public void fireEditingStopped() {
    CellEditorListener listener;
    Object[] listeners = listenerList.getListenerList();
    for (int i = 0; i < listeners.length; i++) {
    if (listeners[i] == CellEditorListener.class) {
    listener = (CellEditorListener) listeners[i + 1];
    listener.editingStopped(changeEvent);
    * Invoked when stops the cell editing when call cancell cell edit method on perticular cell it
    * will removes all editing values
    public void fireEditingCanceled() {
    CellEditorListener listener;
    Object[] listeners = listenerList.getListenerList();
    for (int i = 0; i < listeners.length; i++) {
    if (listeners[i] == CellEditorListener.class) {
    listener = (CellEditorListener) listeners[i + 1];
    listener.editingCanceled(changeEvent);
    and rederer is
    public class CheckBoxCellRendrer extends JCheckBox implements TableCellRenderer {
    public boolean cellEnabled = true;
    * Constructs a new <code>CheckBoxCellRendrer</code> object.
    public CheckBoxCellRendrer() {
    super();
    this.setEnabled(true);
    * Prepares and Returns the Button Renderer component for the table cell to be renderered this
    * will set the value and state of the component then paints on table cell
    * @param table <code>JTable</code> component where the renderer to be painted
    * @param value <code>Object</code> value for the renderer
    * @param isSelected boolean
    * @param hasFocus boolean
    * @param row int
    * @param column int
    * @return <code>Component</code>
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {
    if (table.isCellEditable(row, column)) {
    this.setEnabled(true);
    else {
    this.setEnabled(false);
    if (value != null && value.equals(new Boolean(true))) {
    this.setSelected(true);
    else {
    this.setSelected(false);
    return this;
    * sets the state of the cell
    * @param enabled boolean
    public void setCellEnabled(boolean enabled) {
    cellEnabled = enabled;
    * determines whether this cell is editable or not
    * @param anEvent <code>EventObject</code>
    * @return boolean
    public boolean isCellEditable(EventObject anEvent) {
    return cellEnabled;
    * determines whether this cell is editable or not
    * @param anEvent <code>EventObject</code>
    * @return boolean
    public boolean isCellEnabled(EventObject anEvent) {
    return cellEnabled;
    u need to use the below code to place these in tabe
    TableColumn column1 = ((TableColumnModel) ttable.getColumnModel()).getColumn(1);
    column1.setPreferredWidth(25);
    CheckBoxCellEditor editor1 = new CheckBoxCellEditor();
    column1.setCellEditor(editor1);
    CheckBoxCellRendrer renderer1 = new CheckBoxCellRendrer();
    column1.setCellRenderer(renderer1);
    this may help u.
    regards
    jeevan

  • Click handler on ComboxBox inside TableView

    All
    We have built a table and each row has a comboBox in it. How do I handle different selection events on the combobox and then get access to the row that it was changed on.
    levelCol.setCellFactory(new Callback<TableColumn<LoggerTableRow,String>,TableCell<LoggerTableRow,String>>(){       
                 @Override
                 public TableCell<LoggerTableRow, String> call(TableColumn<LoggerTableRow, String> param) {               
                      TableCell<LoggerTableRow, String> cell = new TableCell<LoggerTableRow, String>(){
                           @Override
                           public void updateItem(String item, boolean empty) {                       
                                if(item != null){
                                     ComboBox<String> comboBox = new ComboBox<>();
                                     comboBox.setItems(loggingLevelList);
                                     comboBox.getSelectionModel().select(item);
                                     setGraphic(comboBox);
                                     setAlignment(Pos.CENTER);
                      return cell;
            });

    If your LoggerTableRow has a property to which that column is bound: i.e. if you have something like
    levelCol.setCellValueFactory(new PropertyValueFactory<LoggerTableRow, String>("level"));then you can just use the built in ComboBoxTableCell:
    levelCol.setCellFactory(ComboBoxTableCell.forTableColumn(loggingLevelList));The combo box is creates will automatically update the level property in the LoggerTableRow object. If you need to perform further actions when that changes, then you can add listeners to those properties.
    If you can't use a ComboBoxTableCell, then I think the steps to add a change listener to the selected item property of the combo box, and call commitEdit(...) when it changes. This will update the property associated to the column. If your LoggerTableRow is a POJO (no FX properties), then you may also need to override commitEdit(...) to update the associated value "by hand". Example 13-11 in the [url http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGAAEE]TableView tutorial gives a fairly full example of a custom editing table cell (using a text field, but it shouldn't be too hard to generalize). Scroll down the code there to the EditingCell inner class.

  • Creating a process with Checkbox inside interactive report

    close
    Edited by: mang jose on Feb 4, 2011 9:21 PM

    Hi,
    Create dynamic Action. Select Advanced
    Event: After Refresh
    Selection Type: Region
    Region: {select your report region}
    Condition: No Condition
    Action: Execute JavaScript code
    Fire On Page Load: True
    Code:
    $('.apexir_WORKSHEET_DATA input[name="f01"]:checked').each(function(){
    $(this).parents("tr:eq(0)").children().css({"background-color":"#00FF66"})
    })Selection Type: None
    I did updated my sample
    https://apex.oracle.com/pls/apex/f?p=40323:53
    Regards,
    Jari

Maybe you are looking for

  • STO's appearing in ME2N

    I have 2 STO's which  are appearing on ME2N report at the top Both orders were cancelled by us and the quantities reduced to 0 Pallets. The shipments have been completed at the plant and according to us they have been received at the other plant. The

  • While burning a disc using CD-R, medium error during burn

    Using blank CD-R to burn photos from a named file, the burn stops and an erroe message occurs "Medium write error"???

  • Switched computers, iTunes not recognizing songs for sync. HELP!

    So my mother has been consolidating content from her older laptop on to her newer desktop. Today she decided to do iTunes while I was at work. From what she told me, she uninstalled iTunes off of her laptop (which was where she was buying/syncing/etc

  • How do I change my searches from Yahoo back to Google?

    I use Mozilla regularly as a browser but may have to resort to something else as this search business is getting on my nerves. I'm a long-term fan of Google which in my opinion, and the opinion of countless others is the best search engine on the mar

  • Very Urgent : Multithreaded - ResultSet ??

    How can a ResultSet handle more than one request at the same time. Can I make ResultSet Multithreaded??How to mak??Giv the code.. Thanks in advance>>