How to avoid table refresh on row selection

Hi,
I have a table where the row selection happens on selecting the check box in the first column of the row. The check box is bound to the transient Boolean attribute of my VO to support this functionality which is missing in new version of ADF. The selection is working fine, however I am facing the issue with table refresh. Everytime I click checkbox to select or unselect a row my whole table is getting refreshed which is very unusual for user point of view. This is my code for the checkbox column:
<af:column sortProperty="isSelected" sortable="true"
headerText="#{bindings.pricingObjects.hints.isSelected.label}"
id="c4"
inlineStyle='#{(row.isSelected)?"background-color: #E7E7E7":""};'>
<af:selectBooleanCheckbox value="#{row.bindings.isSelected.inputValue}"
required="#{bindings.pricingObjects.hints.isSelected.mandatory}"
shortDesc="#{bindings.pricingObjects.hints.isSelected.tooltip}"
id="it4" simple="true"
autoSubmit="true">
<f:validator binding="#{row.bindings.isSelected.validator}"/>
</af:selectBooleanCheckbox>
I have to keep autoSubmit="true" on selectBooleanCheckbox because the table has to change color of the row everytime the checkbox is selected or deselected. Also, there are multiple commandToolbarButton such as "Delete" which needs to be enabled/disabled depending on the row selection.
Is there anyway, I can achieve this behaviour with minimal refresh of table?

Hi Marge,
Yes I do have Add and Delete toolbar button in the panelCollection and also set partialTrigger="tableId" on them. I need this partialTriggers because Delete button should enable/disable depending on number of rows added in the table. However, I tried removing them but it did not work for me, table is still refreshing. BUT this solution does work in combination of other solution i.e. removing ChangeEventPolicy="ppr" on the iterator. I need ppr because I have a form which is bound to the same iterator and should change on table selection. The design is like this,
- Read-only Table on top
- Editable Form below
- Select the row in table and edit the fields in the form
If I remove ppr then my form is not updating with the row selection.
Regards,
Afroz

Similar Messages

  • How to dynamically display the data from a table base on row selection of another table in ADF

    Hi ,
    I have a requirement in ADF. I need to change the data of a table  based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
                                                                                         For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
    My method is following
        public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
    "Definition DepartmentId of type Variable is not found in EmployeesView1."
    I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
    Thanks
    Nilesh

    Note quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
    The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
    However, if both tables are on the same page; using your hack about;
    On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
    I would bind table two to a RichTable component:
    RichTable t2;
    public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
                   refreshTable2(pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    private void refreshTable2(Number pallet){
    RichTable x=getT2();
    CollectionModel cm=(CollectionModel)x.getValue();
    JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
    ViewObject vo =dciter.getViewObject();
    ViewCriteriaManager vcm=vo.getViewCriteriaManager();
    ViewCriteria vc=vcm.getViewCriteria("listById");
    vo.applyViewCriteria(vc);
    vo.setNamedWhereClauseParam("DepartmentId",pallet);
    vo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(getT2());

  • How to avoid data repetation when using select statements with innerjoin

    how to avoid data repetation when using select statements with innerjoin.
    thanks in advance,
    satheesh

    you can use a query like this...
      SELECT DISTINCT
             frg~prc_group1                  "Product Group 1
             frg~prc_group2                  "Product Group 2
             frg~prc_group3                  "Product Group 3
             frg~prc_group4                  "Product Group 4
             frg~prc_group5                  "Product Group 5
             prc~product_id                  "Product ID
             txt~short_text                  "Product Description
    UP TO 10 ROWS
    INTO TABLE l_i_data
    FROM
    Joining CRMM_PR_SALESG and
    COMM_PR_FRG_ROD
    crmm_pr_salesg AS frg
    INNER JOIN comm_pr_frg_rod AS prd
    ON frgfrg_guid = prdfragment_guid
    Joining COMM_PRODUCT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_product AS prc
    ON prdproduct_guid = prcproduct_guid
    Joining COMM_PRSHTEXT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_prshtext AS txt
    ON prdproduct_guid = txtproduct_guid
    WHERE frg~prc_group1 IN r_zprc_group1
       AND frg~prc_group2 IN r_zprc_group2
       AND frg~prc_group3 IN r_zprc_group3
       AND frg~prc_group4 IN r_zprc_group4
       AND frg~prc_group5 IN r_zprc_group5.
    reward it it helps
    Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

  • How to create table with resizable row ?

    how to create table with resizable row ?

    I'd suggest you start here:
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • Table- Why first row Selected from itself

    Hi,
    i have a jspx that have some fields and a button ,
    the user should fill this fields with data then click the button
    the button pass those values to a function that call a Stored Proceudre in the DB
    then the last code in that button is to refresh a table (by execute param) that read the inserted data
    why everytime the table refreshed give me the data with the first row SELECTED!!!!!!!!
    i am using ADFBC + JSF
    thanks in advance

    Hi,
    hope you handled the case where a user hits submit - or performs some other action that is performed on the current row - because you are now in an unpredictable state. Ideally you disable all related command buttons until a user selects a row
    Frank

  • How to create table with 1 row 1MB in size?

    Hello,
    I am doing some R&D and want to create a Table with 1 row, which is 1 MB in size.
    i.e. I want to create a row which is 1 MB in size.
    I am using a 11g DB.
    I do this in SQL*Plus:
    (1.) CREATE TABLE onembrow  (pk NUMBER PRIMARY KEY, onembcolumn CLOB);
    (2.) Since 1MB is 1024*1024 bytes (i.e. 1048576 bytes) and since in English 1 letter = 1 byte, I do this
    SQL> INSERT INTO onembrow VALUES (1, RPAD('A', 1048576, 'B'));
    1 row created.
    (3.) Now, after committing, I do an analyze table.
    SQL> ANALYZE TABLE onembrow COMPUTE STATISTICS;
    Table analyzed.
    (4.) Now, I check the actual size of the table using this query.
    select segment_name,segment_type,bytes/1024/1024 MB
    from user_segments where segment_type='TABLE' and segment_name='ONEMBROW';
    SEGMENT_NAME       
    SEGMENT_TYPE        
    MB
    ONEMBROW           
    TABLE            
    .0625
    Why is the size only .0625 MB, when it should be 1 MB?
    Here is the DB Block related parameters:
    SELECT * FROM v$parameter WHERE upper(name) LIKE '%BLOCK%';
      NUM NAME                                                                                   TYPE VALUE 
      478 db_block_buffers                                                                          3 0     
      482 db_block_checksum                                                                         2 TYPICAL
      484 db_block_size                                                                             3 8192  
      682 db_file_multiblock_read_count                                                             3 128   
      942 db_block_checking                                                                         2 FALSE 
    What am I doing wrong here???

    When testing it is necessary to do something that is a reasonably realistic model of a problem you might anticipate appearing in a production system - a row of 1MB doesn't seem likely to be a useful source of information for "R&D on performance tuning"
    What's wrong with creating millions of rows ?
    Here's a cut and paste from a windows system running 11.2.0.3
    SQL> set timing on
    SQL>
    SQL> drop table t1 purge;
    Table dropped.
    Elapsed: 00:00:00.04
    SQL>
    SQL> create table t1
      2  nologging
      3  as
      4  with generator as (
      5     select
      6             rownum id
      7     from dual
      8     connect by
      9             level <= 50
    10  ),
    11  ao as (
    12     select
    13             *
    14     from
    15             all_objects
    16     where   rownum <= 50000
    17  )
    18  select
    19     rownum          id,
    20     ao.*
    21  from
    22     generator       v1,
    23     ao
    24  ;
    Table created.
    Elapsed: 00:00:07.09
    7 seconds to generate 2.5M rows doesn't seem like a problem.  For a modelling example I have one script that generates 6.5M (carefully engineered) rows, with a couple of indexes and a foreign key or two, then collects stats (no histograms) in 3.5 minutes.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    Now on Twitter: @jloracle

  • How to chop the line "25 rows selected"

    Hi all,
    I am creating reports by connecting Oracle from a shell script using spool,however everything is ok.
    how do I chop the line "25 rows selected" at the end of report?
    Any suggestion!!!!

    set feed off
    before the query.

  • How to avoid blinking / moving of rows in a data grid when you restore the scroll positions

    By Default when an update is made on a data grid, it scrolls to top row. To avoid this when we save the vertical and horizontal scroll
    positions and restore the scroll positions after the update, it causes a blink in the grid (or moving / jumping) of rows. Is there a way to
    avoid this jumping of rows?
    In JavaScript this can be achieved by overriding the scrollToTop / OnLoad methods of datagrid to directly scroll to current scroll
    positions instead of top row. Is there a way to achieve similar feature in flex / actionscript?

    I am calling validateNow().. Also, using verticalScrollPosition to restore the scroller as in the link that you posted.. Reposition is working fine, But the bug filed is regarding BLINKING / JUMPING when this happens (i.e. this blinking is caused because after datagrid edit, during reload the scroller tries to move to  the top by default, then it repositions itself to current edited row as the verticalScrollPosition property is overridden ).. I have to get rid of this blinking.
    In Javascript it is dealt by overriding OnLoad method of datagrid to directly scroll to current scroll position instead of top row during reload so that there is no blinking.
    http://www.sencha.com/forum/showthread.php?13898-Is-there-any-way-to-keep-scroll-position- of-Grid-on-load
    Is there a way to achieve similar feature in flex?
    I am not sure what flex datagrid method to override.. Theres no method like load? What is the datagrid method that is called by default during reload (after datagrid edit) that causes the scroller to go to top?

  • How to capture indexes of multiple rows selected in Advance list

    Hi,
    - I have a prefilled advance list with multiselection enabled.
    - There is a button, associated with an action,which is bind to a eventHandler,that event Handler has script operation which conains the ruby scrpt code.
    - Now when i select multiple rows of that advance list and click on the action,I want to capture the indexes of all the selected rows.
    I tried using following ruby code:
    lead=$data.datalist.LeadSelectedIndex
    But it returns index of only first row selected out of various rows selected.
    So please anyone help me on that.
    Regards ,
    Saurabh Sharma.

    In FP2.6 there is no chance from SDK to have a mass enabled Action and bind to a mulli selection list as a BO Action in the UI Designer, as multiplicity will always be single and only lead selection would be selected.
    this feature comes only in FP3.0.
    So i am not sure what excatly Saurabh wants to do : maybe do some calculations based on multi seletions then i would do the following as also what Christian mentioned
    multiSelect =  ($data.DataList.GetSelectedRowsCount() > 1);
    NoOfRowsSelected = $data.DataList.GetSelectedRowsCount();
    SummationField = 0;
    if ( multiSelect )
       LeadSelection = $data.DataList.LeadSelectedIndex;
       RequiredDataField = $data.DataList.Get(LeadSelection).AnydataField;
       for i in 0..(NoOfRowsSelected - 1)
         currentRow = LeadSelection + i;
          RequiredDataField = $data.DataList.Get(currentRow).AnydataField;
    // imagine this is just add values of the RequiredDataField
         SummationField = SummationField +   RequiredDataField
       end
    end
    So i have not tried this directly - but i hope i make the idea clear.
    Regards,
    Nitesh Pai

  • How to control the number of rows selected from a sybase database table?

    Hi, JDBC guru,
    I'm working on project using Sybase 11.9.x database.We need to process a record in a table,first select it from the table,then do some computing,finally write it to a dbf file, if the above steps succeed,remove the original row in the table.Quite evidently, all these operation should be put into one transaction. But how can I select just a number of rows from the sybase database table?
    Any hints?
    Thank you in advance.
    Regards,
    Jusitne

    Statement stmt...
    stmt.setMaxRows(20);

  • How to avoid displaying a blank row in the table component

    Hi,
    I have a create insert button and a table as in a read only form.
    Each time i click on a create insert button a popup appears were the person enter the corresponding values and on clicking submit button it has to show changes in the table and on clicking cancel button it has to go back to the page.
    But even when i click the cancel there is still an empty row is shown in the table. Is there a way to avoid it ?
    Thanks in advance.

    I am using this managed bean to refresh the table.
    public class popupRefreshBean
    private RichTable refreshTable;
    public popupRefreshBean()
    public void refreshTable(ReturnEvent returnEvent)
    AdfFacesContext adf=AdfFacesContext.getCurrentInstance();
    adf.addPartialTarget(this.getRefreshTable());
    // Add event code here...
    public void setRefreshTable(RichTable refreshTable)
    this.refreshTable = refreshTable;
    public RichTable getRefreshTable()
    return refreshTable;
    }

  • Retrieving a table attribute on row selection

    Hi All,
         In my table display i need to select the 1st attribute of the row (first attribute is item_id) which is selected and then want to retrieve this value.How do i achieve this.Kindly help.
    Thanks n regards,
    Urbashi

    hi urbashi......
                 you can get the selected value by lead selection.
    ie you want the first column that has been selected...
       just read the first column of the node using code wizard.
       it will give the selected value....
    ---regards,
       alex b justin

  • How to make a Jtable's row selected thru program

    Hi , in my application few of the rows (not continous)
    need to get selected automatically when the jTable is intially shown.
    I did this using table.setRowSelectionInterval(0,2)
    This method works fine selecting all the rows from 0 th to 2 th row,
    but if i want only 0 th and 2 th ( excluding the 1 st row ) to be selected , i dont know how to do that???
    i tried the following also
    //indeces of rows to be selected in the table are stored
    //in array
    int[] array = new int [2];
    parray [0]= 0;
    parray [1]= 2;
    table.setRowSelectionInterval(parray[0], parray[0] );
    table.setRowSelectionInterval(parray[2], parray[2] );
    //for each iteration a single row will be selected
    //coz the starting and ending indeces are same ie
    (parray[0],parray[0])
    but when this code is run only the 2 nd row gets selected , what abt the 0'th row???
    please help.
    Thanx.

    sorry
    there is a small correction in the above code
    //indeces of rows to be selected in the table are stored
    //in parray
    int[] parray = new int [2];
    parray [0]= 0;
    parray [1]= 2;
    table.setRowSelectionInterval(parray[0], parray[0] );
    table.setRowSelectionInterval(parray[1], parray[1] );
    //for each iteration a single row will be selected
    //coz the starting and ending indeces are same ie
    (parray[0],parray[0])

  • How to make the default tree row selection programatically

    I have one use case where I am displaying the tree table based on some parameter which is just for filtering the table and display the part of hierarchy.
    The problem here is I want to make a default selected row when the tree will be rendered to UI based on the primary key(that is the input parameter).
    can you please tell me how to do this.I am using jdev 11g.
    thanks,
    Harsh

    Hi,
    for this you need to know where in the path the PK is. If e.g. the PK is for a second level node then you need to pass the first level node PK as well. Nodes in a tree are defined as ArrayLists. So unfortunately your question doesn't provide enough information
    Frank

  • EF 5 Model First Approach- How to avoid Table names from pluralized

    I'm using Entity Framewrok 5.0 Model First approach using Visual Studio 2012 express. The generated database tables are pluralized. How do I avoid this? Please advice. I'm using Model First approach (Designed the entities in the EF designer and generated
    the Database.) . Please note that following technic does not apply to this scenario as it applies to code - first approach.
    using System.Data.Entity.ModelConfiguration.Conventions;
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

    Hi Arasheed,
    Welcome to the MSDN forum.
    I tested your problem. It seems a default setting that Table names are pluralized. If you want to avoid pluralizing, you can do it manually:
    Right click the empty area and select “Generate Database from Model…”.
    Choose the correct connection and click “Next”.
    You will see the generated DDL. Please copy all the content, then click “Cancel”.
    Click “Data” on the Visual Studio bar and select “Tansact-SQL Editor”. Then click “New Query Connection…”.
    Connect to the right server.
    Paste the DDL we copied before.
    Modify the table creation lines. Note: do not forget to change the corresponding name in constraints.
    Right click the empty area and click “Execute SQL”.
    In addition, you can submit your feature requests here to improve Entity Framework:
    http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions
    Good day.
    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us

Maybe you are looking for