Datagrid Checkbox - Select All Headerrenderer

i have a datagrid that utilizes an itemrenderer and headerrender for the same column to have checkboxes and also a select all checkbox in the column header...as such:
<mx:DataGrid width="100%" height="100%" id="dg" dataProvider="{employees}" sortableColumns="false"
                            draggableColumns="false">
                            <mx:columns>
                                <mx:DataGridColumn width="30" textAlign="center">
                                    <mx:headerRenderer>
                                        <mx:Component>
                                            <mx:CheckBox/>
                                        </mx:Component>
                                    </mx:headerRenderer>
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:CheckBox selected="{(data.@isSelected == 'true')?true:false}" click="{data.@isSelected = (data.@isSelected != 'true') ? 'true' : 'false';}"/>
                                        </mx:Component>
                                    </mx:itemRenderer>
                                </mx:DataGridColumn>
                                <mx:DataGridColumn headerText="Item ID" dataField="@id" width="60"/>
                                <mx:DataGridColumn headerText="Date" dataField="@date" width="85"/>
                            </mx:columns>
                        </mx:DataGrid>
my XMLList is as follows (that populates the datagrid):
<mx:XMLList id="employees">
        <request id="720" date="Aug 21 09" isSelected="false"/>
        <request id="721" date="Aug 21 09" isSelected="false"/>
        <request id="722" date="Aug 21 09" isSelected="false"/>
        <request id="723" date="Aug 21 09" isSelected="false"/>
</mx:XMLList>
Now, if I select a rows checkbox, it works fine and updates the XMLList with the new value of isSelected for that row.
My question is this: how do I make it so that clicking on the checkbox inside the headerrenderer selects all the checkboxes in the itemrenderer?  I know that Flex doesn't build rows that are not in view yet, so what needs to happen here in order to a) select the itemrenderer checkboxes and b) update the related XMLList so all isSelected update to either true/false.
Thanks!

Thanks for putting me on the right track for this...quick question:
My arrayCollection looks like this:
[Bindable]
private var myAC:ArrayCollection = new ArrayCollection([
    {id:1, date: 'Bob Jones', isSelected: true},
    {id:2, date: 'Jane Smith', isSelected: true},   
    {id:3, date: 'Doug Johnson', isSelected: false},
    {id:4, date: 'Bob Jones', isSelected: true},
    {id:5, date: 'Jane Smith', isSelected: true},   
    {id:6, date: 'Doug Johnson', isSelected: false},
    {id:7, date: 'Bob Jones', isSelected: true},
    {id:8, date: 'Jane Smith', isSelected: true},   
    {id:9, date: 'Doug Johnson', isSelected: false},      
And the datagrid displays this correctly, so no problems there.
Now, I have a function that gets called when the checkbox in the header is selected, but am stuck here as to how to update all of the isSelected values in myAC to true.
This is what I tried with no success...any thoughts?
public function checkAll():void {
    for(var i:int=0; i < myAC.length; i++){
        myAC.itemUpdated(myAC.getItemAt(i).isSelected, false, true);
Thanks!

Similar Messages

  • Datagrid checkbox headerrenderer check off problem

    I have a datagrid where one column has select option like what we have in mail inboxes. User can select one or many row items to perform any actions by selecting the checkbox. It has also one select all option which is shown in the header renderer of that particular column. If user clicks on that all checkboxes gets selected.
    I have done that but the problem is that whenever i am performing any action by selecting all(header checkbox) and as a result the datagrid sometimes sets visible off or switches to some other mxml component from the component which is holding the datagrid and after coming back from that scenario again to the datagrid, its seen that the checkbox is still checked ... i want that checkbox to set to non-checked.
    help me.

    Hi subhajit nag,
    Say the below is your mxml component in viewStack...
    <your component>
    <mx:Script>
    <![CDATA[
    [Bindable]private var headerChecked:Boolean = false;
    private function onShow():void
         headerChecked = false;
    ]]>
    </mx:Script>
    </your component>
    <mx:DataGrid x="35" y="10" id="mydg">
            <mx:columns>        
                <mx:DataGridColumn editable="true" sortable="false">
                 <mx:headerRenderer>
                  <mx:Component>
                            <mx:CheckBox selected="{outerDocument.headerChecked}" click="checkUnCheckCheckBoxes()">
                             <mx:Script>
                      <![CDATA[
                       import mx.collections.ArrayCollection;
                   private function checkUnCheckCheckBoxes():void
                      // You can handle your logic what you want to do when header check box is clicked....   
                      ]]>
                  </mx:Script>
                            </mx:CheckBox>
                        </mx:Component>
                 </mx:headerRenderer>
                    <mx:itemRenderer>                
                        <mx:Component>
                            <mx:CheckBox selected="{data.isSelected}" click="{data.recselected = !data.recselected}"/>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn headerText="Column 1" dataField="firstName"/>
                <mx:DataGridColumn headerText="Column 2" dataField="lastName"/>           
            </mx:columns>
        </mx:DataGrid>
    So you just need to change the value of the headerChecked  bindable variable to false..in show event for your first scenario...and your header check box is automatically unselected because this check box is binded to a bindable variable to which you are setting to false...
    For your second scenario....you can use the same changing the headerChecked value to false...
    You need to set this varibale to false in your second scenario where you know that your Header Render datagrid is making it visible after you made it unvisible...
    say you have clicked header check box and you made this datagrid invisible and this header checkbox datagrid will be visible once again when you click toggle button so set the value to false in the toggle button click function....
    private function toggleButtonClickHandler():void
         headerChecked = false;
         yourHeaderChkDataGrid.visible = true;
         yourAnotherDG.visible = false;
    Hope this is clear for you now...Try this and let me know...
    Thanks,
    Bhasker Chari

  • To select all the checkbox using valuechangelistner

    Hi ,
    I have a jsp where the check boxes are populated dynamically.
    i have one more check box to select all the check boxes. (like Select all)
    i have written a method in a bean and i have bound that as value changelistner. when i check values in console the check box value is true but the same is not reflected in UI and also when i click delete button the value of the checkbox will be false..
    The value change listner methid is "toggleCheck"
    Please do needfull in this regard..
    here is my code....
    Bean code :
    package com.dyna;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.component.UIData;
    import javax.faces.component.UISelectBoolean;
    import javax.faces.event.ValueChangeEvent;
    * @author Bharathk
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class Output {
         static ArrayList list = new ArrayList();
         private UIData table;
         private UISelectBoolean sb=null     ;
         private UISelectBoolean sbAll=null;
         static int count = 0;
         * @return Returns the list.
         public ArrayList getList() {
              return list;
         * @param list The list to set.
         public void setList(ArrayList list) {
              Output.list = list;
         * @return Returns the sb.
         public UISelectBoolean getSb() {
              return sb;
         * @param sb The sb to set.
         public void setSb(UISelectBoolean sb) {
              this.sb = sb;
         * @return Returns the sbAll.
         public UISelectBoolean getSbAll() {
              return sbAll;
         * @param sbAll The sbAll to set.
         public void setSbAll(UISelectBoolean sbAll) {
              this.sbAll = sbAll;
         * @return Returns the table.
         public UIData getTable() {
              return table;
         * @param table The table to set.
         public void setTable(UIData table) {
              this.table = table;
    public List add(Input obj) {
    Input in = new Input();
    in.setId(obj.getId());
    in.setName(obj.getName());
    list.add(in);      
    return list;
    public List add(Input obj, int index) {
    Input in = (Input)list.get(index);
    in.setId(obj.getId());
    in.setName(obj.getName());
    list.set(index, in);      
    return list;
    public void deleteobj(Output obj){
         int Rc = table.getRowCount();     
         System.out.println("THIS IS IN DELETE");
         for (int i=0; i<Rc; i++) {
              table.setRowIndex(i);
              System.out.println("FROM DELETE------" +obj.sb.isSelected());
              if(obj.sb.isSelected()) {
                   System.out.println("FROM DELETE");
                   list.remove(i);
    public void toggleCheck(ValueChangeEvent event){
         int rc = table.getRowCount();
         System.out.println("THIS IS IN TOGGLE");
         if (sbAll.isSelected()){
         System.out.println("THIS IS IN TOGGLE--IN IF");
                   for (int i = 0; i< rc;i++) {
                   table.setRowIndex(i);
    // table.setRows(rc);                     
    sb.setSelected(true);
                        System.out.println("THIS IS IN TOGGLE--CHECK--- "+this.sb.isSelected());
         else {
              System.out.println("THIS IS IN TOGGLE--In ELSE");
              for (int i = 0; i< rc;i++) {
                        table.setRowIndex(i);
                        sb.setSelected(false);
         /*for (int i = 0; i< rc;i++) {
              table.setRowIndex(i);
              System.out.println("THIS IS IN TOGGLE--CHECK--- "+this.sb.isSelected());
    // FacesContext.getCurrentInstance( ).renderResponse( );
    "Here is my jsp code........."
    <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
    <%@page language="java" contentType="text/html; charset=ISO-8859-1"
         pageEncoding="ISO-8859-1" session="false"%>
    <portlet:defineObjects />
    <LINK rel="stylesheet" type="text/css"
         href='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/theme/stylesheet.css") %>'
         title="Style">
    <f:view>
         <hx:scriptCollector id="scriptCollector1">
              <%-- jsf:pagecode language="java" location="/JavaSource/pagecode/Sample.java" --%><%-- /jsf:pagecode --%>
              <P>Place content here.</P>
              <h:form styleClass="form" id="form1">
                   <TABLE>
                        <TBODY>
                             <TR>
                                  <TD align="left">Id:</TD>
                                  <TD style="width:5px"> </TD>
                                  <TD><h:inputText id="text1" value="#{inp.id}"
                                       styleClass="inputText">
                                  </h:inputText></TD>
                             </TR>
                             <TR>
                                  <TD align="left">Name:</TD>
                                  <TD style="width:5px"> </TD>
                                  <TD><h:inputText id="text2" value="#{inp.name}"
                                       styleClass="inputText">
                                  </h:inputText></TD>
                             </TR>
                        </TBODY>
                   </TABLE>
                   <h:messages styleClass="messages" id="messages1"></h:messages>
                   <BR>
                   <hx:commandExButton id="button1" styleClass="commandExButton"
                        type="submit" value="Submit" action="#{pc_Sample.doButton1Action}">
                   </hx:commandExButton>
                   <h:selectBooleanCheckbox styleClass="selectBooleanCheckbox"
                                                 id="checkbox1" binding="#{op.sbAll}"
    valueChangeListner="#{pc_Sample.op.toggleCheck}" onCleck="this.form.submit();"></h:selectBooleanCheckbox>
                   <BR>
                   <hx:commandExButton type="submit" value="Delete"
                        styleClass="commandExButton" id="button2" action="#{pc_Sample.doButton2Action}"></hx:commandExButton>
                   <BR>
                   <BR>
              <h:dataTable id="table1" value="#{op.list}" binding="#{op.table}" var="varlist" styleClass="dataTable" headerClass="headerClass"
                   footerClass="footerClass" rowClasses="rowClass1"
                   columnClasses="columnClass1" border="0" cellpadding="2"
                   cellspacing="0">
                   <h:column id="column4">
                   <f:facet name="header">
                             <h:outputText styleClass="outputText" value="Select" id="text13"></h:outputText>
                        </f:facet>
                                            <h:selectBooleanCheckbox styleClass="selectBooleanCheckbox"
                                                 id="checkbox12" binding="#{op.sb}" ></h:selectBooleanCheckbox>
                                       </h:column>
                   <h:column id="column3">
                                            <f:facet name="header">
                                                 <h:outputText styleClass="outputText" value="SlNo" id="text10"></h:outputText>
                                            </f:facet>
                                            <h:commandLink styleClass="commandLink" id="link1" action="#{pc_Sample.doLink1Action}">
                                            <h:outputText id="text20"
                                                 value="#{op.table.rowIndex+1}"
                                                 styleClass="outputText">
                                            </h:outputText>
                                  <f:param name="Id" value="#{varlist.id}"></f:param>
                                  <f:param name="Name" value="#{varlist.name}"></f:param>
                             </h:commandLink>
                                       </h:column>
                   <h:column id="column1">
                        <f:facet name="header">
                             <h:outputText styleClass="outputText" value="Id" id="text31"></h:outputText>
                        </f:facet>
                        <h:outputText id="text4" value="#{varlist.id}"
                             styleClass="outputText">
                        </h:outputText>
                   </h:column>
                   <h:column id="column2">
                        <f:facet name="header">
                             <h:outputText styleClass="outputText" value="Name" id="text5"></h:outputText>
                        </f:facet>
                        <h:outputText id="text6" value="#{varlist.name}"
                             styleClass="outputText">
                        </h:outputText>
                   </h:column>
              </h:dataTable>
         </h:form>
         </hx:scriptCollector>
    </f:view>

    http://forums.ni.com/ni/board/message?board.id=60&message.id=8565&query.id=128811#M8565

  • Select all checkbox in ALV tree

    Hi There,
    I have developed a report using ALV tree with 3 level nodes. I have introduced checkbox in one of the column in the node..
    By this I can select the checkbox individually. I have got the requirement to select all the checkboxes simultaneously using a button. I tried several things but no help..
    Please help me with this..I have used class 'cl_gui_alv_tree' for designing the Tree.

    Hi,
    You need to add a button to the toolbar manually, when the button is pressed loop at all the nodes that have a checkbox and update the checkbox field.
    Something like....
    data:  go_tree1     type ref to cl_gui_alv_tree,
           go_toolbar   type ref to cl_gui_toolbar
    * Add buttons to the toolbar
      call method go_tree1->get_toolbar_object
        importing
          er_toolbar = go_toolbar.
      check go_toolbar is not initial.
      call method go_toolbar->add_button
        exporting
          fcode     = 'SELALL'
          icon      = icon_select_all
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Select All'.
    * Define an event handler
    data: go_receiver  type ref to lcl_event_receiver.
    class lcl_event_receiver definition.
      public section.
        methods:
          function_selected for event function_selected of cl_gui_toolbar
                  importing fcode.
    endclass.
    class lcl_event_receiver implementation.
      method function_selected.
        case fcode.
          when 'SELALL'.
            perform select_all.
      endmethod.
    * Register the event
      create object go_receiver.
      set handler go_receiver->function_selected for go_toolbar.
    form select_all.
      data: lv_field type lvc_fname.
    * Update the checkbox on each node of the ALV tree
      lv_field = 'CHECK'.   "Whatever you've called the checkbox
      call method go_tree1->change_item
        exporting
          i_node_key     = node_key   "<-- loop at the nodes and repeat for each one with a checkbox
          i_fieldname    = lv_field
          i_data         = ' '
        exceptions
          node_not_found = 1
          others         = 2.
      call method go_tree1->frontend_update.   "call this onces all updates have been made
    endform.
    Regards,
    Darren

  • How to set selected all checkboxes in all dataTable's rows?

    Hi there,
    I'm trying to perform this simple task: having a dataTable with a column containing checkboxes, how can I allow (with a button, a "super" checkbox or so) to simultaneously set selected all checkboxes in all rows?
    And - is it possible to do so without calling the submit of the page?
    Thanks to everyone!

    Yes, the paging for <h:dataTable> works pretty good, it manages the task through four methods created in the java code -- DataTable1_firstPageAction(), DataTable1_previousPageAction(), DataTable1_nextPageAction(), DataTable1_lastPageAction() -- without adding any javascript in the jsp page.
    Maybe I could test if a java script similar to the <ui:table>'s one fit also the dataTable...
    thanks

  • Comma Separated Checkboxes.... select all?

    How do you set up a button to select all of the check boxes created by the widget. I know how to do this using a javascript with normal html checkboxes but the widget type apparently doesn't have a checked field? What am i missing?

    How do you set up a button to select all of the check boxes created by the widget. I know how to do this using a javascript with normal html checkboxes but the widget type apparently doesn't have a checked field? What am i missing?

  • End User SPAM Quarantine checkbox to select all messages not working

    We are running SPAM Quarantine on M670 running 8.1.0-476 and accessing with Internet Explorer 9.0.   After logging into the SPAM Quarantine there is a top row check box that normally we can check to select all messages.  This stopped working in IE for us, any idea what setting/option we could adjust to enable it again?
    In Chrome 29, FireFox 23 it works as expected.
    Jason

    I think this is a know bug in 8.0, see below:
    CSCuj42166
    Selecting all messages in ISQ at once not possible with IE 8.0/7.0/6.0
    Symptom:
    When accessing the spam quarantine on ESA using IE 8.0/7.0/6.0 and trying to select all messages at once, an error occurs and no message is checked. At the bottom of the browser we see an "Error on page"
    Conditions:
    ESA running 8.0.0-671 and Internet Explorer 8.0 (same valid for 6.0 and 7.0)
    Workaround:
    Using a different browser to access the Centralized Spam Quarantine like for example Safari, Mozilla Firefox, Google Chrome, Internet Explorer 9
    Further Problem Description:
    Details
    Known Affected Releases: (2)
    8.0.0(Venetian)-671 | 8.5.0(FourQueens)-0
    Known Fixed Releases: 0
    Release Pending
    Product: Cisco Email Security Appliance

  • I want to sync my Voice Memos but iTunes 10.5 will not let me even with the "include voice memos" checkbox selected.

    I want to sync my Voice Memos but iTunes 10.5 will not let me even with the "include voice memos" checkbox selected. As well Ive deselected all the music in itunes so when I sync there will be none on my phone but itunes also ignores this request and puts purchased music back on. I do not have autofill selected. Also wondering where the backup of my iphone 4s is located on my hard disk. Any help greatly appreciated.

    Sorry thats itunes 11.5

  • Select all in table element

    Hello all,
    I created a table element which contains a column of check boxes.
    I want to add to my table an option to check/uncheck all the check boxes.
    I already created the events but I dont know how to call the events I created using the table?
    Thanks in advance,
    Tomer

    Hi Tomer,
    you haven't said how your gui should look like. For example you can add two buttons ("select all" and "Unselect all") for this task. Now you add two actions, one for each button. Add the actions as eventtarget in the properties of the buttons. And in the event-methods of the actions you write your code to select/deselect the checkboxes, like
    public void onActionSelectAll(...) {
        for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
            wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(true);
    public void onActionUnselectAll(...) {
        for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
            wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(false);
    HTH,
    Frank

  • Needed select all button in alv report

    Dear Experts,
                    In alv report i want first field as button selectall then remaining fields must be displayed
    this is my code,,
    DEFINE m_fieldcat.
      is_fieldcat-fieldname = &1.
      is_fieldcat-hotspot   = &2.
      is_fieldcat-seltext_m = &3.
      is_fieldcat-col_pos   = &4.
      is_fieldcat-outputlen = &5.
      is_fieldcat-emphasize = &6.
      is_fieldcat-Checkbox  = &7.
      append is_fieldcat to it_fcat.
      clear is_fieldcat.
    END-OF-DEFINITION.
    m_fieldcat 'SLNO'     ''        text-112   '1'   '5'   'C310' ''.
    m_fieldcat 'KPI'      ''        text-110   '2'   '30'  'C310' ''.
    m_fieldcat 'PWEEK'    'X'       text-109   '3'   '16'  'C310' ''.
    m_fieldcat 'CWEEK'    'X'       text-111   '4'   '16'  'C310' ''.
    m_fieldcat 'MONTH'    'X'       text-122   '5'   '16'  'C310' ''.
    m_fieldcat 'PMONTH'   'X'       text-132   '6'   '16'  'C310' ''.
    m_fieldcat 'UOM '      ''       text-138   '7'   '10'  'C310' ''.
    Thanks,
    Thiru. R

    Hi,
    You can keep first field as checkbox. 'Select All' button is present in ALV whnever you use 'REUSE_ALV_GRID' F.M.
    You can click on select all button that appears in ALV grid toolbar and all your checkboxes that appears in first field will get selected. Similar to 'Select All' there is 'Deselct All' button also in ALV grid.
    Regards,
    Saba

  • Select all button is not working in ALV List Display

    Hi All,
    I am displaying output by using lav list display. afer displaying the output iam showing my own pf status here. in my pf status i am havinh one button called 'SELECT ALL' when i click this button it has to select all the checkboxees in my output. but it is not happening like that any body can siggest me what shall i do in this case.
    i am sending my code below.
    type-pools : slis.
    tables : zuser_secobjects.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
          end of it_secobjects.
    data : wa_ita like line of it_secobjects.
    *data : it_secobjects like zuser_secobjects occurs 0 with header line.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    p_edate(10) default '12/31/9999',
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
      INCLUDE ZVR_MAHI7_F01                                              *
    form user_command using p_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
    case p_ucomm.
    when 'DELETE_ALL'. " SELALL is the FCODE of ur push button
    loop at it_secobjects into wa_ita.
    wa_ita-checkBOX = 'X'.              "<--  Change this
    modify it_secobjects from wa_ita.
    endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
    endcase.
    endform.
    *&      Form  delete
    form delete.
    *data: is_secobjects type zuser_secobjects.
      data : begin of is_secobjects occurs 0.
              include structure zuser_secobjects.
      data : checkbox type c.
      data : end of is_secobjects.
    *IF FLAG = 'X'.
      is_secobjects-checkbox = 'X'.
      modify is_secobjects
        from it_secobjects
        transporting checkbox
      where checkbox = 'X'.
    endform.
    *&      Form  get_data
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform.                    " get_data
    *&      Form  prepare_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_fieldcatalog.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
      i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
    endform.                    " prepare_fieldcatalog
    *&      Form  ALV_LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alv_list_display.
      i_repid = sy-repid.
      call function 'REUSE_ALV_LIST_DISPLAY'
           exporting
                i_callback_program       = i_repid
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = is_lout
                it_fieldcat              = i_field[]
           tables
                t_outtab                 = it_secobjects.
    endform.                    " ALV_LIST_DISPLAY
    anybody can modify the code  and resend it to me.
    thanks,
    maheedhar.t

    Hi,
    In the user command write the code as per the sample given below:
    FORM select_all .
      CLEAR v_lisel.
      DO.
        READ LINE sy-index FIELD VALUE v_chk.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        READ LINE sy-index FIELD VALUE sy-lisel INTO v_lisel.
        IF v_lisel+2(1) = ' ' AND sy-index GT 5.
          v_lisel+2(1) = 'X'.
          MODIFY LINE sy-index FIELD VALUE sy-lisel FROM v_lisel.
        ENDIF.
      ENDDO.
    ENDFORM.                    " select_all
    reward if useful
    regards,
    ANJI

  • How to count number of checkboxes selected from a table in sapui5

    Hi
    I have a table in which one of the column is checkbox.
    Now user can check 'n' number of checkboxes in the same column.
    So now i need to count the number of checkboxes selected in that column.
    how to do that..??
    Please help me on this.
    Thanks
    Sathish

    Hi Sathish,
    If you are using table mean surely you are binding the table to some model like JSON model. You can bind the checked value of the column with the checkbox in the template. So while checking you can directly check the property by taking the reference from the model. Navigate through all the objects in the model and check  the property you wanted.
    This is the logic I have used to get the checked property form the table column. My table id is "tableId" and it is being binded with "/tableModelData" of json model.
      var myModel = sap.ui.getCore().getElementById("tableId").getModel().getProperty("/tableModelData");
      for(var i= 0 ; i< myModel.length ; i++)
      var singleObject = myModel [i];
      if(singleObject.checked ==  true){
    your logic.

  • How to SELECT ALL records of a TABLE VIEW in the BSP page

    Hi All,
    In the BSP portal, I am displaying some data(multple records) in the form of a table using the BSP TAG <htmlb:tableView>. I wrote the logic in the 'VIEW' of the BSP application which will be triggered by the controller. I have used the attribute selectionMode = "MULTISELECT" to have a Check Box to select a row.
    My requirement is to have a button/checkbox on the first column of the header of the table view. By clicking on this, it should select/desect all the records of the table. Could someone please help me how to do this? What attribute I should use in the tableview to get the button in the header row of the table and how to select all the records of the table.?
    Please provide your valuable inputs.
    Thanks & Regards,
    Paddu.

    Select all / Deselect all functionality when onRowSelection is there

  • SSRS report parameter left blank to select all

    Hello,
    Before posting this question I have looked at related topics and couldn't find a clear answer!
    Question: Is there a workaround for a parameter to select all if blank?
    I have a report that has a multivalue parameter, my user is asking if there is a way to have an empty parameter box that will default to selet all, so if the user does not fill parameter and clicks on view report it should work.
    I have tried:
    SELECT Item FROM ItemTable
    UNION ALL
    SELECT '' AS Expr1 ORDER
    BY Item
    Then checked Allow Blank Value ''
    and checked Allow Null Values
    and did the change in my query. The problem here is that the parameter will have null check box which the user does not want see?
    Thanks

    Hi There
    Thanks for yourposting. I think you do not need to click on checkbox allow null value, just check allow blank value and change in your dataset query like this.
    Please change the query but the synxtax might look like this
    if @commenttype=''
    select * from Comment_Type
    else
    select * from Comment_Type
    where
    Comment_Type=@commenttype
    if @commenttype=''
    select * from Comment_Type
    else
    select * from Comment_Type
    where
    Comment_Type=@commenttype
    By default your parameter is blank and you display all records, but when user type something it will filter the datset based on the user input
    I am putting some screenshot for your help.
    If you have any questions pelase let me know
    Many Thanks
    Syed Qazafi Anjum
    Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.

  • Check box Select All

    Hi all,
    I have created a Report with
    select EMP_no,
    EMP_name,
    Sal,
    apex_item.checkbox(2,EMP_no) CHK
    from emp
    Order by 1
    where I want have the Select All check box on th etop of the CHK Column for that i used
    <input type="checkbox" onclick="$f_CheckFirstColumn(this)" /> as Heading of the Column
    so when i clicked on Heading Column Chk BOX all chk box in that column selected but if UN chk on one of the Chk box in the Report the TOp heading CHk box has to Be unchk but its happenig wats the Solution for that?
    Regards
    798545
    Edited by: 798545 on Oct 1, 2010 6:35 AM
    Edited by: 798545 on Oct 1, 2010 6:35 AM

    Hi all,
    I have created a Report with
    select EMP_no,
    EMP_name,
    Sal,
    apex_item.checkbox(2,EMP_no) CHK
    from emp
    Order by 1
    where I want have the Select All check box on th etop of the CHK Column for that i used
    <input type="checkbox" onclick="$f_CheckFirstColumn(this)" /> as Heading of the Column
    so when i clicked on Heading Column Chk BOX all chk box in that column selected but if UN chk on one of the Chk box in the Report the TOp heading CHk box has to Be unchk but its happenig wats the Solution for that?
    Regards
    798545
    Edited by: 798545 on Oct 1, 2010 8:28 AM

Maybe you are looking for

  • Pictures and music not showing

    Sorry for posting multiple times. I bought the curve recently with the media card alrdy installed. I connected the curve to laptop and transfered all the pics. and music. When i checked the media file on curve, nothing was there and more interesting

  • Can I change option for Consolidating Duplicate Fonts?

    I work for a textbook publisher. Our materials are constantly be proofed, updated, and repurposed. Several of the titles are over 1,000 pages. We are experiencing very significant hangups when it comes to "Consolidating Duplicate Fonts" when we repla

  • Adding a segment to a Basic IDOC type

    Hi every one, How do i add a segment that I have created to an existing Basic Idoc type ?. Can some one give me a solution for this. Thanks, Arul.

  • System-jazn-data.xml corruption after few ADF Application Deployments in Weblogic 11g

    We have been facing issues of system-jazn-data.xml getting corrupted after deploying some ADF Applications causing impact on other deployed applications accessibility. As a work around, we need un-deploy the application and restore the template jazn

  • Importing DB info from Sybase to Oracle 9i

    Could someone please tell me if it is possible to import a sybase db into oracle 9i. The reason, I need to be able to import and excisting DB from sybase to Oracle for a project.