cancel
Showing results for 
Search instead for 
Did you mean: 

Clear TableView Selected rows - Urgent

0 Kudos

Hi All,

I have a stateful BSP application. I have a tableview in that applications. I have the multiselect option in that table. Is there any way to clear the previous selected rows of the table. The table is getting new data without any problems but the previously selected line remain on the table Would appreciate if anyone could help me out as it is Urgent !!

Best Regards,

Sudhi

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

try calling

cl_htmlb_manager=>check_tableview_all_rows(

rowcount = rowcount

request = request

id = <tableviewid>

check = ' '

  • KEYTABLE = KEYTABLE

).

Regards

Raja

0 Kudos

Hi Durairaj,

Thanks for the timely help but what do we give in the request of this method ?

Your help is much appreciated.

Best Regards,

Sudhi

athavanraja
Active Contributor
0 Kudos

cl_htmlb_manager=>check_tableview_all_rows(

rowcount = rowcount

request = <b>request</b>

id = <tableviewid>

check = ' '

  • KEYTABLE = KEYTABLE

).

just say request. (this is an already instantiated object available for BSP - check by clicking the signature button in the application toolbar)

Regards

Raja

0 Kudos

This is beautiful.. thanks a lot Durairaj for your solution. It is working just fine. I also thank all of the others for the replies as well.. My problem was only with the highlightling part of it. The data was absolutely fine. I could handle the data part of it without any issues.

Answers (1)

Answers (1)

Former Member
0 Kudos

I guess u r asking abt the clearance of internal table rows.

Refresh your itab after declaration and clear it content at the end .

Hope this helps .

Regards,

J

Revert back if you still face problems.

Do Award points for helpful answers .

0 Kudos

Hi J,

No it is not the Internal table but it is the TableView itself. The tableview on the html page remembers the previous highlighted rows of the table. Even though the data changes on the page the previous rows remain highlighted.

Best Regards,

Sudhi

Former Member
0 Kudos

Hi Sudhi,

You can follow up using this sample code. Here you can set a flag variable which is updated in onInputProcessing event.

Layout:


<htmlb:form>
     <%
        if flag is initial.
      %>
      <htmlb:tableView id              = "tab1"
                       table           = "<%= itab %>"
                       visibleRowCount = "8"
                       design          = "ALTERNATING"
                       footerVisible   = "TRUE"
                       selectionMode   = "multiSelect"
                       keepSelectedRow = "true" >
      </htmlb:tableView>
      <%
        endif.
      %>
      <%
        if flag eq 1.
      %>
      <htmlb:tableView id              = "tab2"
                       table           = "<%= itab %>"
                       visibleRowCount = "8"
                       design          = "ALTERNATING"
                       footerVisible   = "TRUE"
                       selectionMode   = "multiSelect"
                       keepSelectedRow = "true" >
      </htmlb:tableView>
      <%
        clear flag.
      %>
      <%
        endif.
      %>
      <htmlb:button id      = "but01"
                    text    = "Click"
                    onClick = "myEvent" />
    </htmlb:form>

OnInputProcessing:


DATA: tv TYPE REF TO cl_htmlb_tableview.
DATA: event TYPE REF TO cl_htmlb_event.
event = cl_htmlb_manager=>get_event( runtime->server->request ).

IF event->id = 'but01' AND event->event_type = 'click'.

  tv ?= cl_htmlb_manager=>get_data(
                  request      = runtime->server->request
                  name         = 'tableView'
                  id           = 'tab1' ).

  IF tv IS NOT INITIAL.

    DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
    tv_data = tv->data.

    DATA : itab2 TYPE TABLE OF selectedrow,
         ind TYPE selectedrow,
         row_s TYPE zdi_so.

    CALL METHOD tv_data->get_rows_selected
      RECEIVING
        selected_rows = itab2.

  ENDIF.

  IF itab2 IS NOT INITIAL.
    DATA :rw LIKE LINE OF itab.

    LOOP AT itab2 INTO ind.
           flag = '1'.
      DELETE itab INDEX ind-index.

    ENDLOOP.
  ENDIF.
ENDIF.

Hope this helps,

Regards,

Ravikiran.

Message was edited by: Ravikiran C