Select all rows in af:table

Hi,
I need to select all rows in af:table, not only on current page.
I have following code on custom select all action:
getTable2().getSelectionState().addAll()and on button that needs to perform some action on selected rows I have this code
        Set selectedRowSet = getTable2().getSelectionState().getKeySet();
        if (!selectedRowSet.isEmpty()) {
            Iterator it = selectedRowSet.iterator();
            while(it.hasNext()) {
                Key key = (Key)it.next();
       }selectedRowSet.iterator() method throws java.lang.ClassCastException: oracle.jbo.Key.
When I select rows with af:tableSelectMany, which is inside selection facet and selects only rows on current page, this works fine.
Any ideas?
Thanks

Hi,
you can only access those data that is queried and part of the CollectionModel to the time you select all
   RichTable _table = employeesBackingBean.getEmployeeTable1();
   RowKeySet rks = new RowKeySetImpl();
  CollectionModel model = (CollectionModel)_table.getValue();
  int rowCount = model.getRowCount();
      for (int i = 0; i < rowCount; i++) {
           model.setRowIndex(i);
           //note that in the simple POJO case, the row key is the same
           //as the index. However, it would be wrong to just rely on this
           //because other models or custom table models my return a more
           //comples key. Therefore we iterate over the available rows to
           //obtain the keys.
           Object key = model.getRowKey();
           //add the row keys to the RowKeySet to mark selected
           rks.add(key);
   _table.setSelectedRowKeys(rks);
   AdfFacesContext.getCurrentInstance().addPartialTarget(_table);Frank
Frank

Similar Messages

  • I am unabel to select all rows in advance table using Select All option

    Hi all ,
    I am unable to select all the rows in advance table . Select All option in advance table selects all rows present in working page but doesnt select the rows which we get by clicking next button ... i am having a requirement to select all the rows with a single click on select all , is it possible ..
    Plz help
    Thanking you all

    Hi,
    I'm using an adf table but i don't want to have the "Select All" and "Select None" options above the table. Does someone know how i have to remove those links?
    Or is there indeed a solution to override the methodes of those links?
    Message was edited by:
    Alexander

  • Select All rows  in WebDybpro Tables

    Hi All ,
    I am working on NWCE 7.1 . i have table in my UI. and want to give slect all rows functionality in table. in NWCE is there
    any way to give select all rows in table with out using , button and writing action to iterate node bound to table.
    also i want to know about RowCreator ui element for table.(when we right click on table we get insert -> rowcreator). How this works
    Thanks in advance
    Regards
    Kavita

    Hi Kavita,
    The row creator Ui element is not visible in table itself you can see it only in outline window.
    and in its on create event you have to write the code which i have provided above. it will not be visible in table at design time but at run time when you will click on the last rows lead selection it will call the associated event and one row will be added to the table.
    Regards
    Jeetendra

  • HOW TO SELECT ALL ROWS IN A MULTI SELECT TABLE!!!!!

    Hello
    I have a table with tableSelectMany component. how can I set the page to initially select all rows when first opened?????

    efffffttttttt? are you saying you will do an electronic funds funds funds funds funds transfer transfer transfer transfer transfer transfer to anyone who answers?
    What version of JDeveloper are you using - that is quite important in order to be able to give you an answer.
    What also might be useful is "please" and "thank you" instead of SHOUTING IN ALL CAPS THAT YOUR QUESTION IS IMPORTANT. Realizing that you asked this question over a weekend when most people dont sit and read the forum...
    You have a habit of saying all your questions are URGENT!!!!!! which is generally considered, um...., impolite.

  • How to select all rows in table automatically after refreshing?

    Hi,All
    After refreshing the table,I want to select all rows,like MultipleButton's function.
    How can I do?
    Thanks
    Smile.

    Hi,-Grif-
    * Set the selected state for the given row groups
    * displayed in the table.  This functionality requires
    * the 'selectId' of the tableColumn to be set.
    * @param rowGroupId HTML element id of the tableRowGroup component
    * @param selected Flag indicating whether components should be selected
    function selectGroupRows(rowGroupId, selected) {
      var table = document.getElementById("form1:table1");
      table.selectGroupRows(rowGroupId, selected);
    }I don't know that the parameter selected is a boolean,or the checkbox(radio button) id?
    Thanks
    Smile

  • Selecting multiple rows in a table

    Hi All,
    I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
    please provide me solution for this.
    Thanks & Regards,
    Sreelakshmi.

    HI
    Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
      for(int i=0;i<wdcontext.nodeModelNode.size;i++)
        if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
               String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
               String  address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
               String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
            Create a method for the Table Property onLeadSelect() where you can open a popup window
             Create a value node and with attributes same as Table attributes and then set the values of the table
             to the value node attributes.
    Thanks

  • Selecting all rows in ALV on a button click

    Hi Experts
    Hi,
    I have a dynamic ALV table. I also have a button 'Select All Rows'. On clicking the button I want all the rows in the ALV table selected which is done by using set_selected method at the context node.
    All the rows in the alv is selected after clicking select_all except for the first row.
    Need your inpts to solve the same.
    Regards
    Karthick

    Use the folowing code
    *... get model
      data:
        lr_model type ref to cl_salv_wd_config_table.
      lr_model ?= me->r_model.
    *... get columns
      data:
        ls_column type salv_wd_s_column_ref,
        lt_column type salv_wd_t_column_ref.
      lt_column = lr_model->if_salv_wd_column_settings~get_columns( ).
      data:
        l_selected type abap_bool.
      loop at lt_column into ls_column.
        l_selected = abap_false.
        read table value transporting no fields with key column = ls_column-id.
        if sy-subrc eq 0.
          l_selected = abap_true.
        endif.
        try.
            me->if_salv_bs_model_column~set_selected(
              column = ls_column-id
              value = l_selected ).
          catch cx_salv_bs_sc_object_not_found.             "#EC NO_HANDLER
        endtry.
      endloop.

  • How to set selected all rows in h:dataTable

    hello, I want to selected all rows in a dataTable.
    I use JS to got it:
    the selectBooleanCheckbox in the header of row:
    <t:selectBooleanCheckbox id="aa" value="#{list.checkbox}" />the JS code :
    <script type="text/javascript" language="JavaScript1.2">
        function selectAll(obj, first, size) {
            for (var i = 0; i < size; i++) {
                var current = eval(first - 1 + i);
                var objs = document.getElementById("form:listbody:listtable:" + current + ":aa");
                obj.checked ? objs.checked = true : objs.checked = false;
    </script>and the "selectall" code:
    <h:selectBooleanCheckbox id="selectAll"
                                  onclick="javascript:selectAll(this,#{firstRow},#{displayedRowsCount})"/>It run good in IE,but not it does not work in firefox.
    Are there some method to do?
    Or is there a method to select all rows just use JSF?
    Needs you help!

    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

  • Enable Buttons after selection of row in a table

    Hi All
    Could any one give me help in this. I have a table, in table tool bar some buttons are there. at first time buttons are in disable mode, when user select any row in the table the buttons should be in enable mode. how to do this? help me
    Thanks,
    kris.

    hi,
    for table you have lead select action. you can write the code in this ction method to enable and disable the buutons based on the lead selection.
    or you ca alsoput your code in modify view and check if the instance of element is bound then enable else disable,
    lo_element = lo_node->get_element(). Lo_element will be bound only if there is a lead selection in the table.
    if lo_element is bound.
    enable the buttons.
    else.
    disable the buttons.
    endif.
    Regards,
    Madhu

  • How do I create a Search Help which selects some rows from a table?

    Well, I'm trying to be specific.
    I have a parameter with a search help that shows columns BUKRS and BUTXT for ALL rows form the table T001. What I need is restrict the search help to show only three Values: BUKRS = 1000 BUKRS = 2000 BUKRS = 3000. This is like a search help with a SELECT sentence. How do I do it?

    Hi.,
    you can go through thomas sir's suggestion. But my suggestion is If you are working in a custom Report , dont change it at Table level or Domail Level., Instead, use Function Module for Custom F4 help.,
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bukrs.
    CALL FM F4IF_INT_TABLE_VALUE_REQUEST.
    check this help for your reference: http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm.
    If you are using Standard Report Check for Exits.
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Dynamic Select of Row in a table in webdynpro Abap

    Hi,
      I have an requirement, I have an table  and a button, I need to select a row in a table based on button action.
    For example : in a table i have 3 rows. I am submiting a value in a button, I want to see that row highlighted for the value I am sending through button.
    Please let us know the code how to implement this.
    Thanks

    Hi,
    First you have to go to table and set its property "SELECTION MODE" to single or multi lead depending on ur need.
    Then in the ACTION of the button you can use the following code to get the values in the selected row.
    DATA:
         node to get table node for finding no. of rows
            lo_nd_one  TYPE REF TO if_wd_context_node,
         Get selected row for finding no. of rows
       it_table               TYPE        wdr_context_element_set,
         workarea to get selected row
            wa_table                LIKE LINE OF           it_table,
    To get the Selected line item into an internal table
      CALL METHOD lo_nd_one->get_selected_elements
        RECEIVING
          set = it_table.    " data in internal format
      IF it_table[] IS NOT INITIAL.
      type conversion for work area
        READ TABLE it_table INTO wa_table INDEX 1.
    if a row is present
        IF  sy-subrc IS INITIAL.
        Get the values of each attribute
          CALL METHOD wa_table->get_static_attributes
            IMPORTING
              static_attributes = wa_final.       "<Selected data in work area.>  ---> this will have your data
        ENDIF.
    Here wa_final is the work area which is of your table fields type.
    This wa_final will have the selected row.

  • SQL query problem:  how tp select all duplication in the table?

    Hi all,
    I have a table with the following columns:
    1. contact_id
    2. fname
    3. lname
    4. email
    The email column must be unique (unfortunately it's not); therefore, I have to delete all duplication in the system.
    Question: how can I select all duplication in the table?
    I tried this...didn't work (I'm expecting only the emails that are duplicated)
    THANK YOU!
    SELECT distinct TC1.email, TC1.contact_ID FROM ta_contacts AS TC1 where TC1.email <>'' AND TC1.email not in (   SELECT distinct TC2.email   FROM ta_contacts AS TC2   where TC2.email <>'' )

    Sounds like an SQL and not a JDBC question. In any case, if a column needs to be unique, then you should, of course, designate a unique constraint on the table so you never end up with duplicates in the first place.

  • Select ALL rows in ALV by an ACTION

    Hi All -
    Is possible to have a button with an Action "select all" and when the user trigger that action all the records in the ALV are selected?
    i.e ALV has 10 records (lines or rows) and user click on a button with text "SELECT ALL" and once they click that button all the rows/lines are selected.
    Thanks!
    Jason P-V

    Hi ,
    yes it can be done....
    here is the procedure to do it.....
    first we need to make the context node "selection" property equals to "0..n"  you can find this property at your component controller level.....where you set your "cardinality" as well...
    than create a button in your view layout where the alv is being displayed and write the following code for button action:
    DATA lo_nd_alv_table TYPE REF TO if_wd_context_node.
    navigate from <CONTEXT> to <alv_table> via lead selection
       lo_nd_alv_table = wd_context->get_child_node( name = wd_this->wdctx_alv_table ).
    DATA counter TYPE i.
      counter =   lo_nd_alv_table->get_element_count( ).
      DO counter TIMES.
          lo_nd_alv_table->set_selected(
        EXPORTING
        index = sy-index ).
      ENDDO.
    I just tested this...and it worked for me....
    Thanks...
    AS...
    Just forgot to mention....if you want to de-select them all...you can use the method:
    lo_nd_alv_table->CLEAR_SELECTION(
    the above code can be put in in the btn action method.....say you have two btns one to select all rows and one to de-select all....
    this code can go under de-select all btn action method.....
    Edited by: J Are on Dec 11, 2009 8:53 PM

  • Delete all rows in a table

    I have read two articles how to use sql adapter with delete.
    http://btsguru.blogspot.se/2011/10/wcf-sql-adapter-table-operations.html
    http://social.technet.microsoft.com/wiki/contents/articles/29146.biztalk-server-2013-crud-operation-with-wcf-sql-adapter-and-correlation.aspx?wa=wsignin1.0
    Is it a way to delete all rows in a table?
    I have tried to send <ns0:Rows>*</ns0:Rows> with no luck.
    Challan

    I'm not expert in Biztalk but one of the options to call stored procedure that contains the delete script:
    http://geekswithblogs.net/StuartBrierley/archive/2011/10/19/biztalk-server-2010---using-the-wcf-sql-adapter-to-make.aspx
    Sql Delete all rows from table Script:
    DELETE FROM table_name;
    or 
    TRUNCATE TABLE mytable;
    Trucnate vs Delete:
    http://www.mssqltips.com/sqlservertip/1080/deleting-data-in-sql-server-with-truncate-vs-delete-commands/
    Fouad Roumieh

  • Select a row from a table and throw an url

    Hi experts,
    I'm trying to select a row from a table in Visual Composer. What I need to do it's to click over this row and throw an Url. At the moment, I've added a column with a Pushbutton with the formula to show the link; it works fine. But I need to do it without buttons just selecting the row.
    Is there anyboby who knows about that?
    Thanks a lot.
    Belen

    Hi
    To do this you will have to use a data store and a guard condition on the line which is triggered by the select action. You need to store a value in the data store each time a select action is performed. The guard condition should check for this and only perform the action when the value in the data store is greater than 0.
    Jarrod Williams

Maybe you are looking for

  • Permitted payee error message while posting an invoice

    HI,    I already define permitted payee in the vendor master record.But when i am creating an invoice through FB60, in the payment segment we are having an option to select payee. When i am clicking F4, then it is giving me an error message stating t

  • Changed email addy, now app updates needs old email.

    I recently deleted my gmail account that was used for one of my apple id`s, and changed it to Yahoo email. Now some old apps i have are asking me to log in with gmail to update the apps. It is the exact same account all i have done is changed the ema

  • Special Batch Rename; remove trailing characters and make sequential

    Hello, I'm looking to make an Automator droplet which Accepts a handful of files Removes the last three characters while preserving the extension Applies a trailing set of numbers to make the files sequential In my googling, I have found several work

  • Hard drive "does not meet the requirements" for system updates

    Hi, I'm running 10.2 and I'm trying to update my computer to the more recent version, except that I've gone through the update downloads on this site and anything higher than 10.3 tell me I need to run 10.3 to run it. When I tried to upgrade to 10.3,

  • Simple Servlet question, pls help

    This is my form submission part in my jsp page <form name="updateForm" method="POST" action="/Update"> This is my web.xml <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN