cancel
Showing results for 
Search instead for 
Did you mean: 

Popup : Search Result Table View with Multi-Select Feature

Former Member
0 Kudos

Dear All

     I have created a custom view that displays the Search Result in a Table View as a Pop-Up.

     And this table view should have a capability to select mutiple lines and trigger a collective action.

      I have done all major steps and I was able to see the data in table view.. but what missing is left corner Line Selection Button...

Yeah something similar to below is missing that allows multiple lines to be selected from table view.

Please advise and help....

Table View tag has   selectionMode         = "<%= ZRESULT->SELMODE_MULTI

Cheers

RJ

Accepted Solutions (0)

Answers (1)

Answers (1)

ajaya_kumar
Active Participant
0 Kudos

Hi RJ,

You can refer the below code:

<%@page language="abap" %>

<%@extension name="chtmlb" prefix="chtmlb" %>

<%@extension name="thtmlb" prefix="thtmlb" %>

<%

  data: lv_multi        type abap_bool.

  data: lv_select_mode  type string.

  data: lv_select_event type string.

  data: lt_button       type crmt_thtmlb_button_t.

  data: ls_button       type crmt_thtmlb_button.

  data: lv_rowcount     type string.

  data: lv_size      type i.

  data: lv_enabled   type abap_bool .

 

  result->set_selection_mode( lv_select_mode ). 

  lv_select_event = 'select'.

  data: lr_coll type ref to if_bol_bo_col.

  lr_coll = RESULT->collection_wrapper->get_marked( ).

  if lr_coll is bound.

  lv_size = lr_coll->size( ).

  if lv_size > 0.

  lv_enabled = abap_true.

  else.

  lv_enabled = abap_false.

  endif.

  endif.

 

%>

<chtmlb:tableExtension tableId = "Table"

                       layout  = "FIXED" >

  <chtmlb:configTable id                    = "Table"

                      navigationMode        = "BYPAGE"

                      onRowSelection        = "<%= lv_select_event %>"

                      selectedRowIndex      = "<%= RESULT->SELECTED_INDEX %>"

                      selectedRowIndexTable = "<%= RESULT->SELECTION_TAB %>"

                      selectionMode         = "<%= RESULT->SELECTION_MODE %>"

                      table                 = "//RESULT/Table"

                      usage                 = "SEARCHRESULT"

                      visibleRowCount       = "<%= lv_rowcount %>"

                      width                 = "100%"

                      hasLeadSelection      = "X"

                      downloadToExcel       = "FALSE"

                      showNoMatchText       = "FALSE" />

</chtmlb:tableExtension>

<%

  if lv_multi eq abap_true.

%>

</br>

<thtmlb:button id      = "CHOOSE_BTN"

               enabled = "<%= lv_enabled %>"

               onClick = "CHOOSE"

               text    = "<%= page->otr_trim( 'CRM_BSP_FRAME_GENERIC/F4_SUBMIT' ) %>" />

<%

  endif.

%>

Refer the below code for select event:

  

METHOD eh_onselect.

* used in the multiselect case
  DATA: lv_event TYPE REF TO cl_htmlb_event_tableview.

  TRY.
      lv_event ?= htmlb_event.
    CATCH cx_sy_move_cast_error.
      EXIT.
  ENDTRY.

  me->typed_context->result->eh_on_row_selection(
         iv_htmlb_event    = lv_event
         iv_htmlb_event_ex = htmlb_event_ex ).

ENDMETHOD.

Hope this would help!

Regards,

Ajay

Former Member
0 Kudos

Ajay

  Many Thanks for this.

My codes are almost same...  Still the problem persists.. I am unable to see the left Line Selection Button...

any help.?

Tag:

<chtmlb:configTable

                       actions               = "<%= controller->gt_button %>"

                       actionsMaxInRow       = "5"

                       id                    = "Table"

                       onRowSelection        = "select"

                       navigationMode        = "BYPAGE"

                       table                 = "//ZRESULT/Table"

                       width                 = "100%"

                       selectedRowIndex      = "<%= ZRESULT->SELECTED_INDEX %>"

                       selectedRowIndexTable = "<%= ZRESULT->SELECTION_TAB %>"

                       selectionMode         = "<%= ZRESULT->SELECTION_MODE %>"

<%--                      selectionMode         = "<%= ZRESULT->SELMODE_MULTI %>"--%>

                       allRowsEditable       = "FALSE"

                       usage                 = "SEARCHRESULT"

                       visibleRowCount       = "10"

                       displayMode           = "TRUE"

                       personalizable        = "TRUE"

                       downloadToExcel       = "TRUE"

                       noHeader              = "FALSE"

                       hasLeadSelection      = "X"

<%--                      HEIGHT                = "120px"--%>

                                            />

ajaya_kumar
Active Participant
0 Kudos

Hi RJ,

have you tried 

result->set_selection_mode( lv_select_mode ).     in your .htm?

Regards,

Ajay

Former Member
0 Kudos

hi,

you need to first set the selection mode for the table context node as below.

me->typed_context->resultnode->set_selection_mode( cl_bsp_wd_context_node_tv=>selmode_single ).you can write this statement in do_prepare_output method.

Former Member
0 Kudos

I will try this and let u know...

Former Member
0 Kudos

Have done this already.

former_member214667
Contributor
0 Kudos

Check the DO_INIT_CONTEXT( ) method -> the selection mode is typically set from here.

Former Member
0 Kudos

Hi Remo

Could you try with changing the attribute " allRowsEditable   = "TRUE" ?