cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Tableviewcolumns event

Former Member
0 Kudos

HI All,

I want to do eventhandling for tableviewcolumn,

I am giving one link in my tableviewcolumn,when user clicks that column link it should redirect to next page or view.

Can anyone tell me how i can acieve this funtionality.

This is my view now what should i write in DO_HANDLE_EVENT?

when user clicks EVSHT, it should go to next page or view.

<htmlb:tableViewColumns>

<htmlb:tableViewColumn columnName = "EVSHT"

title = "Course Code"

onItemClick = "EVSHT"

type = "link"

sort = "TRUE"

/>

<htmlb:tableViewColumn columnName = "EVSTX"

title = "Course Name"

onItemClick = "EVSTX"

type = "link"

/>

<htmlb:tableViewColumn columnName = "EVBEG"

title = "Begin Date"/>

<htmlb:tableViewColumn columnName = "EVEND"

title = "End Date"/>

<htmlb:tableViewColumn columnName = "LOCTX"

title = "Location"/>

</htmlb:tableViewColumns>

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

You can use Tableview with Iterator to achieve this easily:

Look at the similar issue in following thread:

[Tableview column as link |]

Regards,

Raja

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Can i try this similar functionality in Do_Handle_event because i am using BSP with MVC.

and i have two controllers.

In one controller i am calling one view, and in another controller i am writing this tableview ,

from this table view column , i am giving as a link for the table entries, when user clicks this link it should call the another controller which is inside the same BSP application.

I am trying to do something like this to call another controller.

DATA:

l_tableview_event TYPE REF TO cl_htmlb_event_tableview,

l_nextpage TYPE string.

IF htmlb_event is BOUND.

IF htmlb_event->name = 'tableview'.

l_tableview_event ?= htmlb_event.

ENDIF.

CASE htmlb_event->server_event.

WHEN 'EVSHT'.

  • me->mc_view = 'catalog.htm'.

l_nextpage = 'catalog.do'.

ENDCASE.

ENDIF.

This is not the complete code, i am trying for complete table view initially , instead of tableview i should use tableviewcolumn here.

correct me if i am wrong here, i am doing this BSP application first time.

Thanks,

Vinay

Former Member
0 Kudos

Thanks Guys .I will try this solution and if i have any issues i revert you back.

Thanks,

Vinay

former_member188685
Active Contributor
0 Kudos

Using Table View iterator you can do this.

In side iterator you can use BEE and add the hyperlink.

You have check the sample Code..

In the Render cell start

METHOD if_htmlb_tableview_iterator~render_cell_start.

  row_data = p_row_data_ref.

  DATA: input TYPE REF TO cl_htmlb_inputfield,
        wa_html TYPE REF TO cl_bsp_bee_table.

  FIELD-SYMBOLS: <fs> TYPE vbap.

  ASSIGN row_data->* TO <fs>.

  CASE p_column_key.

    WHEN 'VBELN'.
      IF p_row_index = 1 OR p_row_index = 5.
        p_style = 'celldesign:GOODVALUE_MEDIUM'.
      ELSE.
        p_style = 'celldesign:BADVALUE_MEDIUM'.
      ENDIF.

    WHEN 'MATNR'.

    create object wa_html.

    wa_html->add_html( HTML   = '<a href="http://www.google.com/">'  ).
    wa_html->add_html( HTML   = <fs>-matnr ).
    wa_html->add_html( HTML   = '</a>'  ).

    P_REPLACEMENT_BEE = wa_html.

  ENDCASE.

ENDMETHOD.

In the Layout

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title=" " >
    <htmlb:form>
      <htmlb:tableView id       = "t1"
                       table    = "//model/it_vbap"
                       iterator = "<%= controller %>" />
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

I included my Iterator in my controller itself.

if you have any doubts can revert back.