Skip to Content
author's profile photo Former Member
Former Member

Handling Tableviewcolumns event

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>

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Jul 23, 2008 at 12:55 AM

    You can use Tableview with Iterator to achieve this easily:

    Look at the similar issue in following thread:

    [Tableview column as link |tableview-column-as-link]

    Regards,

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2008 at 08:40 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 03:55 PM

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

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 04:33 PM

    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'.

    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

    Add a comment
    10|10000 characters needed characters exceeded

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.