Multiple row selection in ADF Table using addition column with checkbox

I am using ADF table(Jdeveloper11g) and i want to selecte multiple rows it may be more than one OR all rows.
For that i added one Column to the table with Header Delete and checkbox
<af:table....
<af:column sortProperty="Delete" headerText="Delete" width="100"
sortable="false">
<af:selectBooleanCheckbox label="#{row.favoriteId}"
valueChangeListener="#{Mybean.onCheck}"
id="checkbox" autoSubmit="true">
</af:selectBooleanCheckbox>
</af:column>
</af:table>
backing bean:Here i added code to get Value of one column with id favoriteId and use an arrayList(listForDelete) to monitor the state of the checkboxes
public void onCheck(ValueChangeEvent valueChangeEvent) {
BindingContainer bindings = getBindings();
DCBindingContainer dcBindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iterBind =
(DCIteratorBinding)bindings.get("getUserFavoritesByUserIDIterator");
if (iterBind != null && iterBind.getCurrentRow() != null) {
RichSelectBooleanCheckbox ch = (RichSelectBooleanCheckbox)valueChangeEvent.getSource();
if (!ch.isSelected()) {
Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
listForDelete.add(issueId);
else
Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
listForDelete.remove(issueId);
Problem is that when i select single row checkBox, onCheck() method of backing bean gets called multiple times(equals to the number of rows)
I think this is beacuse of <af:selectBooleanCheckbox id is same that is "checkbox" but i am not sure.Even i tried to assign some unique id but no any success in assigning Id with value Expression.
I also find related post
Re: ADF Table Multiple row selection by Managed Bean
but that is related to Select All rows or Deselect all rows from table.
From the simillar post i follow the steps given by Frank.but problem with below step
->have an af:clientAttribute assigned to the checkbox with the following EL #{row.key} ,here I added <af:clientAttribute name="#{row.key}"></af:clientAttribute> and i am getting error
Error(64,37):  Static attribute must be a String literal, its illegal to specify an expression.
Please let me know if any one had already implemented same test case.
Thanks for all help
Jaydeep
Edited by: JaydeepJ on Aug 7, 2009 4:42 AM

just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
DCBindingContainer bc =
(DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
DCIteratorBinding profItr =
bc.findIteratorBinding("ProfileSearchInstIterator");
Row cRow = profItr.getRowAtRangeIndex(0);
if(cRow != null){
System.out.println("Current row is not null so fixed ");
profItr.setCurrentRowIndexInRange(0);
RowKeySetImpl rks = new RowKeySetImpl();
ArrayList keyList = new ArrayList();
keyList.add(cRow.getKey());
rks.add(keyList);
profileTable.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
}

Similar Messages

  • Row selection in adf table issue after commit or rollback

    Using jdev 11g (11.1.1.62)
    I have a adf table with multi select enabled. There is a child table bounded at BC4J level via a VL
    On the rowSelectionListener I attached a bean method. This bean method bascially finds the selected row from UI and then based on it query the child vo again and then finally refreshes the child table.
    This works fine as expected.
    However, what happens is when the Cancel button is called on UI which is bound to a rollback action in the AMImpl then the UI refreshes. And the master table still shows the previously selected row but the child VO shows the rows of the first master VO row rather the selected one.
    How to fix this? Further as old row is already selected in the master table so reclicking on the same row does nothing,

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • How to perform Autosubmit  on Row selection in ADF Table

    Hi,
    I am using ADF Table , in which I want to enable AutoSubmit for the Table Row Selection.
    I want to enable some button on my screen when a row is selected in the table.
    I want to achive this with out using SelectionListener .. any iputs for this?
    Thanks,
    Swathi

    Hi Timo,
    here is my code : this code is to implement Custom shuttle .. where I am using two ADF Tables to display the Available list and Selected List ..and using navigation buttons to move the selected item.When I select a Row in the left table .. I want to enable the 'add' button.
    <af:table value="#{pageFlowScope.ebean.al}" var="row"
                      rowBandingInterval="0" varStatus="vs" id="t2"
                      rowSelection="single"
                      binding="#{pageFlowScope.ebean.availableList}"
                      partialTriggers="::cb2 ::cbAdd ::cbRemove"
                      summary="#{backingBeanScope.BundleBean.MEASURES}"
                       selectionListener="#{pageFlowScope.ebean.rowSelection}"
                      inlineStyle="height:200.0px;" horizontalGridVisible="false">
              <af:column sortProperty="Name" sortable="false"
                         headerText="Name"
                         id="c3" width="300" rowHeader="unstyled">
                <af:panelGroupLayout id="pgl6">
                  <af:image source="/images/file_ena.png" id="i2"
                            shortDesc="#{backingBeanScope.BundleBean.FILE_ENA}"/>
                  <af:outputText value="#{row.label}" id="ot2"/>
                </af:panelGroupLayout>
              </af:column>
            </af:table>
          </af:panelGroupLayout>
          <af:panelGroupLayout id="pgl3" layout="vertical"
                               inlineStyle="width:39px;">
            <af:commandButton id="cbAdd"
                              actionListener="#{pageFlowScope.ebean.onAdd}"
                              partialSubmit="true"
                              disabled="#{pageFlowScope.ebean.dataToAdd==null}"
                              icon="/images/shuttleright_ena.png"
                              shortDesc="#{backingBeanScope.BundleBean.ADD}"
                              partialTriggers="t2"/>
            <af:spacer width="10" height="10" id="s1"/>
            <af:commandButton id="cbAddAll" action="addAll"
                              actionListener="#{pageFlowScope.ebean.onAddAll}"
                              disabled="#{pageFlowScope.ebean.availableListSize==0}"
                              icon="/images/shuttlerightall_ena.png"
                              shortDesc="#{backingBeanScope.BundleBean.ADD_ALL}"
                              partialTriggers="cbRemove"/>
            <af:spacer width="10" height="10" id="s2"/>  
            <af:commandButton id="cbRemove" partialSubmit="true"
                              actionListener="#{pageFlowScope.ebean.onRemove}"
                              icon="/images/shuttleleft_ena.png"
                              shortDesc="#{backingBeanScope.BundleBean.REMOVE}"
                              partialTriggers="t3"
                              disabled="#{ pageFlowScope.ebean.dataToRemove==null}"/>
            <af:spacer width="10" height="10" id="s4"/>
            <af:commandButton id="cbRemoveAll"
                              actionListener="#{pageFlowScope.ebean.onRemoveAll}"                         
                              icon="/images/shuttleleftall_ena.png"
                              shortDesc="#{backingBeanScope.BundleBean.REMOVE_ALL}"
                              disabled="#{pageFlowScope.ebean.listSize==0}"
                              partialTriggers="cbAdd "/>
          </af:panelGroupLayout>
          <af:panelGroupLayout id="pgl5">
            <af:outputText value="#{backingBeanScope.BundleBean.SELECTED_MEASURES}#{pageFlowScope.ebean.listSize}#{backingBeanScope.BundleBean.CB}"
                           id="ot3"
                           inlineStyle="font-weight:bold; font-size:small;"
                           partialTriggers="cbAdd cbRemove"/>
            <af:table value="#{pageFlowScope.ebean.sl}" var="row"
                      rowBandingInterval="0" varStatus="vs" id="t3"
                      rowSelection="single"
                      binding="#{pageFlowScope.ebean.list}"
                      partialTriggers="::cbAdd ::cbAddAll ::cbRemove ::cbRemoveAll"
                      summary="#{backingBeanScope.BundleBean.MEASURES}"
                      selectionListener="#{pageFlowScope.ebean.rowSelection}"
                       inlineStyle="height:200.0px;" horizontalGridVisible="false">
              <af:column sortProperty="Name" sortable="false"
                         headerText="Name"
                         id="c5" width="300" rowHeader="unstyled">
                <af:panelGroupLayout id="pgl9">
                  <af:image source="/images/file_ena.png" id="i3"
                            shortDesc="#{backingBeanScope.BundleBean.FILE_ENA}"/>
                  <af:outputText value="#{row.label}" id="ot1"/>
                </af:panelGroupLayout>
              </af:column>
            </af:table>
        </af:panelGroupLayout>
    public void rowSelection(SelectionEvent selectionEvent) {
            RichTable at = (RichTable)selectionEvent.getComponent();
            if(at.getId().equals("t2"))
                getDataToAdd();
            else          
               getDataToRemove();       
        public Object getDataToAdd(){
            if(availableList!=null)
         return availableList.getComponent().getSelectedRowData();
            return null;
        public Object getDataToRemove() {       
            if (list != null && list.getComponent().getSelectedRowKeys()!=null)
                    return list.getComponent().getSelectedRowData();
            return null;
        }Thanks,
    Swathi

  • Multiple Rows Selection In Advance Table

    Hi All,
    I have a requirement to select multiple rows in advance table.After selection these rows they get added to the record list of another page on click of seeded submit button.This is my custom region.And this functionality is working for seeded region.
    I have added multiple selection component in advance table component.
    How should I make this functionality work for my custom region using the seeded submit button.
    Regards,SHD

    Hi,
    After selection these rows they get added to the record list of another page on click of seeded submit buttonon the click of submit button save the data to the table from where u are getting the data for the other page....Once this data get saved to the table, will definitely shows up in next page.
    Regards,
    Gyan

  • Retrieving multiple rows selected from a table

    I want to retrieve selected multiple rows from a table and pass it to other views. Does anyone know how to implement this

    You could try a simple example:
    Create a context node "Rows" with a string attribute "Text". Create some node elements in wdDoInit().
    Create an action "ShowSelectedRowIndices" and implement the event handler as follows:
      //@@begin javadoc:onActionShowSelectedRowIndices(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionShowSelectedRowIndices(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionShowSelectedRowIndices(ServerEvent)
        StringBuffer msg = new StringBuffer("Multi-selected rows:");
        for (int i = 0; i < wdContext.nodeRows().size(); ++i)
          if (wdContext.nodeRows().isMultiSelected(i))
            msg.append(" ").append(i);
        wdComponentAPI.getMessageManager().reportSuccess(msg.toString());
        //@@end
    When executing the action (e.g. with a button) you will see the selected indices in the message area.
    Regards, Armin

  • How to delete the row from the ADF table using popup box

    Hi,
    I have one requirement like need to delete a record from the table, but that time need to show one popup window for confirmation of the deletion. I am using Delete buttom from the vo operations. I am able to delete the row with out popup but when i used the popup that time deletion is not happening.
    Can any one help me in this.
    Regards,

    Issue was resolved.

  • ADF multiple row selection using checkbox

    One of the basic feature missing in ADF 11g is multiple row selection using checkbox (ADF supports multiple row selection by CTRL+CLICK) and business users doesn't like the idea of CTRL+CLICK especially when the volume of click is more. Our requirement is to show the records as selected, on click of checkbox. We implemented multiple row selection by giving a checkbox and on submission, iterate all the rows and filter only selected rows for further processing. The approach works fine,but it is very slow when the volume of data is more, say 10 thousand rows. For 4 thousand records, iterating everything takes more than 200 secs !
    Had the multiple row selection been the ADF standard way using CTRL+CLICK, and retrieving the selected rows using method theTable.getSelectedRowKeys() works much faster (completes in millisecs for 4 thousand records). Somehow ADF fetches the selected records much faster this way. Our requirement is on click of the checkbox, the ADF should select the records ( the same way it is doing CTRL+CLICK) and all such selected rows should be retrievable using the ADF method theTable.getSelectedRowKeys()
    Is there any way it can be done?
    Regards,
    Antony.

    Hi All,
    We have implemented the select and select all using check-box and it is working fine. Issue here is the performance is too slow
    Assume SelectValue is the VO coulmn for the checkbox to select the values. To filter out the selected rows, we use the following line
    Row[] pidRows = pidView.getFilteredRows("SelectValue", Boolean.TRUE);
    it is very taking more than 2 minutes if the total number of rows are *4 thousands* and only if 2 rows are selected.
    Whereas with the CTRL+CLICK standard approach, ADF has a built in API theTable.getSelectedRowKeys(); to get only the selected rows, and the built in API takes only few milliseconds to get the selected rows. Users are not agreeing to the CTRL+CLICK approach as it is not user friendly. Suggest if there is a way to make the select box to make it work the same way as CTRL+CLICK.
    code snippet to do the standard way :
    RowKeySet sk = theTable.getSelectedRowKeys();
    _logger.info("row count of select "+sk.getSize());;+
    Iterator selection =sk.iterator();
    EmpVORowImpl empRow = null;
    +while (selection.hasNext()) {+
    Object rowKey = selection.next();
    theTable.setRowKey(rowKey);
    rowdata = (JUCtrlHierNodeBinding)theTable.getRowData();
    empRow  = (EmpVORowImpl)rowdata.getRow();
    _logger.info("Emp # "+empRow.getEmpno() +" Emp Name : "+empRow.getEname() +" Is selected ? "+empRow.getisChecked());+
    +}+

  • Selected rows appear in random order when selected from ADF Table

    Hi All,
    I am working in ADF 10.1.3
    I have a ADF Table with a multi select option associated with a DataBean, My requirement is when I select multiple rows from the table and click on some button to goto next page, the selected rows are not getting populated as per the selection order.
    Example: If I select 1st,3rd,5th,7th,9th rows from the ADF Table then in the next page I see the results as 3rd,1st,5th,9th,7th. - Randomly it is getting displayed.
    I am using the following code to get the records from Multi select ADF Table.
    I am adding the selected records to a List.
    selectedRowSet = this.getTable1().getSelectionState().getKeySet();
    rowSetIter = selectedRowSet.iterator();
    if (selectedRowSet.size() > 0)
    Integer index = Integer.parseInt((String) rowSetIter.next());
    Object rowData = this.getTable1().getRowData(index.intValue());
    The order is getting jumbled when I see the final list.
    Pls help me in this.
    Thanks

    Hi Frank,
    Thanks for the update.
    We are using 10.1.3.3 and already our application in QA Testing. User need this to be fixed. Is there any work around for this problem?
    Thanks
    JP

  • 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 get selected row values in a table using check box

    Hi ADF Experts,
    JDEV Version 11.1.1.7.0
    My requirement is getting the selected row valuesof a af:table using a checkbox(multi select).
    Thanks,
    Animesh

    Hi,
    add a transient attribute to the POJO entity and update this through a check box. The ensure you have autosubmit=true set on the check box. In a value change listener set or remove the row's checbox attribute value
    Frank

  • Multiple row selection capability in the table

    Hi
    I have a group with table layout style and I want to set the rowSelection property of the generated table to "multiple" but it seems that there is no way to do that from JHs unless using the group as LOV, which is not desired for me. Here is the code which sets this property in tableGroup.vm :
    #if (! ($JHS.current.group.useAsLov && $JHS.current.group.multiSelect))
    selectionListener="#{#BINDINGS_TABLE().collectionModel.makeCurrent}"
    rowSelection="single"
    #if( ! $JHS.current.group.useAsLov )
    selectedRowKeys="#{#TABLE_BEAN().selectedRow}"
    #end
    #else
    rowSelection="multiple"
    selectedRowKeys="#{#LOV_PAGE_BEAN().selectedRowKeySet}"
    selectionListener="#{#LOV_PAGE_BEAN().selectionListener}"
    #end
    Is there any reason to not allowing to have multiple row selection capability in the table when it is not in LOV mode?
    Thanks
    Ferez

    Ferez,
    No, but if you want to have multiple selection, there is typical a custom action you want to apply to the selected rows, which cannot be defined in the Jheadstart Application Definition editor.
    However, it is perfectly fine to use a custom tableGroup.vm template and enable multi-selection.
    Steven Davelaar,
    JHeadstart team.

  • How to create multiple rows in a child table from the multi select Lov

    Hi
    We have Departments and EmployDept and Persons tables and each employee can associate multiple departments and vice versa.While creating a Department page there should be a Multi Select LOV(values from Persons table) with search option for the Persons.From the search panel we can select multiple persons for that department.Suppose we have selected 5 persons and click on submit, then it should create 5 rows in the EmployDept table for 5 persons with that department id.
    Any inputs on how to implement this scenario please..

    Maybe you can get some ideas from here -
    http://adfdeveloper.blogspot.com/2011/07/simple-implementation-of-af.html

  • Multiple row select for table not working..

    Hi Experts,
    I have a table in ABAP Web Dynpro where I have enabled the multiple row select functionality. I can select all and deselect all. I can also select a block of adjacent rows of table by choosing first and last by pressing Shift key.
    But I am not able to select multiple individual records for that table.
    I tried the same thing in different system and it works fine there.
    Please let me know if we are missing some standard plugin or we need to enable this in some settings.
    System where the issue is:
    SAP_APPL: release 600, level 18
    SAP_BASIS: Release 700, level 22
    System where it is working fine:
    SAP_APPL: release 604, level 8
    SAP_BASIS: release 701, level 8
    Regards,
    Anand Kolte

    Hi
    Press CTRL key and Select records, you can select multiple records, continuously or randomly your desired selection.
    Cheers,
    Kris.

  • Multiple row selection for table element

    Hi,
    I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
    I have defined a node with cardinality and selection set to 1..n.
    The contex node contains 4 fields : emp_name, pernr, manager and position.
    The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
    I have defined an action on the 'onleadselection' event.
    The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).' 
    When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
    Thanks in advance for any assistance.

    Hi raj,
    you can try the following code in the 'onleadselect' event of the table,
    create one attribute ' Flag'  of type WDY_BOOLEAN under the node which has been binded to the table.
    DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
      DATA  lo_elements TYPE wdr_context_element_set.
      DATA  lo_ele_select_new TYPE REF TO if_wd_context_element.
      DATA lv_deselect TYPE wdy_boolean.
      DATA lv_flag TYPE wdy_boolean.
      DATA lv_select TYPE wdy_boolean.
      DATA lv_index TYPE i VALUE 0.
      lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
    get the current selected element
      lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
      CHECK lo_ele_select_new IS NOT INITIAL.
    check whether it has been selected or not
      CALL METHOD lo_ele_select_new->is_selected
        RECEIVING
          flag = lv_select.
      lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
    check whether element has been previously selected or not,if not, set the flag to select it
    IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
        lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
    if selected currently and previously then set the flag as false,in order to delect it
      ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
        lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
      ENDIF.
      CALL METHOD lo_nd_node_tab1->get_elements
        RECEIVING
          set = lo_elements.
    according to the falg, select and delect the elements
    LOOP AT lo_elements INTO lo_el_node_tab1.
        lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
        IF lv_flag = 'X'.
          lo_el_node_tab1->set_selected( abap_true ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).  * this statement deselects the lead selection index*
        ELSE.
          lo_el_node_tab1->set_selected( abap_false ).
          lo_nd_node_tab1->set_lead_selection_index( lv_index ).
        ENDIF.
      ENDLOOP.
    I hope this resolves your problem.
    Thanks,
    krishna

  • Hide multiple rows in a dynamic table based on the row value.

    Hi,
    I need to hide multiple rows in a dynamic table based on the specific value of that row.
    I cant find the right expression to do that.
    please help

    Go to the Row Properties, and in the Visibility tab, you have "Show or hide based on an expression". You can use this to write an expression that resolves to true if the row should be hidden, false otherwise.
    Additionally, in the Matrix properties you should take a look at the filters section, perhaps you can achieve what you wish to achieve through there by removing the unnecessary rows instead of just hiding them.
    It's only so much I can help you with the limited information. If you require further help, please provide us with more information such as what data are you displaying, what's the criteria to hiding rows, etc...
    Regards
    Andrew Borg Cardona

Maybe you are looking for