Skip to Content

Deselect the row in a table

Hi All,

How to deselect the row in a table?

I am using the following code to display a table and "select" a row.

        <thtmlb:cellerator design                = "STANDARD"
                           id                    = "casetable"
                           onHeaderClick         = "HeaderClick"
                           onRowSelection        = "RowSelection"
                           selectionMode         = "SINGLE"
                           selectedRowIndex      = "<%= controller->gv_selected_row %>"
                           selectedRowIndexTable = "<%= controller->gt_selected_rows %>"
                           iterator              = "<%= controller->gr_me %>"
                           table                 = "<%= ZL_ZADJ_SEARCH_IMPL=>GT_CASE %>"
                           fillUpEmptyRows       = "FALSE"
                           horizontalScrolling   = "TRUE"
                           rowSelectionByLineClick = "TRUE"
                           verticalScrolling     = "TRUE"
                           visibleFirstRow       = "1"
                           visibleRowCount       = "100"
                           width                 = "100%"
                           personalizable        = "TRUE"
                           showPersonalizeButton = "FALSE"
                           usage                 = "EDITLIST"
                           columnDefinitions     = "<%= it_tabcols %>" >

Thanks,

Chandra Indukuri

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2011 at 12:54 PM

    use this code to deselect the rows..

    typed_context-><your table context node>->deselect_all( ) .

    Regards

    Snehasish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 12, 2011 at 11:39 AM

    Hi,

    You have an attribute 'onRowSelection' the value that you give for this attribute is name of event that is raised after you select the row.

    Create an event handler method having same name as that of value in attribute.

    For a code to deselect, please have a look at method EH_ON_ROW_SELECTION in class CL_BSP_WD_CONTEXT_NODE_TV.

    read table ME->SELECTION_TAB with key TABLE_LINE = LV_ROW_INDEX

    binary search transporting no fields.

    if SY-SUBRC = 0.

    • line was marked -> unmark it

    if ME->FILTER_ACTIVE = ABAP_TRUE.

    ME->LAST_LINE_ITERATOR->UNMARK( IV_INDEX = LV_ROW_INDEX ).

    else.

    ME->COLLECTION_WRAPPER->UNMARK( IV_INDEX = LV_ROW_INDEX ).

    clear ME->SELECTED_INDEX.

    endif.

    else.

    • line was not yet marked -> mark it

    if ME->FILTER_ACTIVE = ABAP_TRUE.

    ME->LAST_LINE_ITERATOR->MARK( IV_INDEX = LV_ROW_INDEX ).

    else.

    ME->COLLECTION_WRAPPER->MARK( IV_INDEX = LV_ROW_INDEX ).

    ME->SELECTED_INDEX = LV_ROW_INDEX.

    endif.

    endif.

    Hope this helps.

    e Regards,

    Bhushan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 12, 2011 at 11:47 AM

    Hi Chandra,

    As per the HTML code it should have got deselected by standard feature.

    The Event Handler EH_ON_ROW_SELECTION decides which row to be selected and deselected.

    Have debugger in this Event handler as this gives clue why the standard code is failing.

    Regards,

    Sijo

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Chandra Indukuri

      Hi,

      Please ensure that the famework clas method eh_on_row_selection is being called in your context node class eh_on-row_sleection.

      Ie when you open the context ndoe class method EH_ON_ROW_SELECTION,you should be able to see this code.

      CALL METHOD super->eh_on_row_selection

      EXPORTING

      iv_htmlb_event = iv_htmlb_event

      iv_htmlb_event_ex = iv_htmlb_event_ex.

      me->selection_mode = selmode_single.

      If not,please add the supe class method call and also the setting of the selection mode.

      Suvidha

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.