cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a tooltip to a TableView header Column

Former Member
0 Kudos

Hi,

I would like to add Tooltip to the Header Column in a Table view.

In below table view, if I point or move my cursor over Column (ID), then it should show tooltip as "Employee ID'. How to add this tooltip? Please let me know.

IDName
1ABC
2DEF

I tried with Table view iterator class by modifying the parameter TOOLTIPHEADER in Class: GET_COLUMN_DEFINITIONS, but its not displaying the tooptip.

Thank you

Anji

Accepted Solutions (1)

Accepted Solutions (1)

former_member210661
Active Contributor
0 Kudos

Hi Anji,

This we can achieve by using render_cell_start method. i will give brief explanation how to achieve this.

create one class and provide interface with the name IF_HTMLB_TABLEVIEW_ITERATOR go to each and every method activate.



then go to your table view class and create one method (ex get_iterator and exporting parameter is RR_ITERATOR type ref to if_htmlb_tableview_iterator ) double click on that method write the logic like this..

CREATE OBJECT rr_iterator TYPE cl_iccmp_do_linkheader_iterato. activate.

then go tableview.htm write like this...

<%

DATA: lr_iterator TYPE REF TO if_htmlb_tableview_iterator.

lr_iterator = controller->get_iterator( ).

%>

place the lr_iterator into your configcelletor iterator field..

then you will get the tool tip for every field..

output.

let me know if you any doubts..

Thanks & Regards,

Srinivas.

Former Member
0 Kudos

Thanks Srinivas for the response.

As per the changes you have mentioned, it will give same tooltip as the name of the column. In this case BusinessPartner for both.

What I wanted is Column Name as 'BP' and tooltip as 'Business Partner'.

Thank you

Anji

former_member210661
Active Contributor
0 Kudos

Hi Anji,

if you want to provide tool tip as per your requirement then you have to implement RENDER_CELL_START method.

provide your tool tip.

ex:

   DATA lr_line_ref      TYPE REF TO your structure.

   DATA lr_text_bee      TYPE REF TO cl_thtmlb_textview.

   lr_line_ref ?= p_row_data_ref.

   CASE p_column_key.

     WHEN 'BP'.

       CREATE OBJECT lr_text_bee.

       lr_text_bee->id   = p_cell_id.

       lr_text_bee->text = lr_line_ref->object_id.

       lr_text_bee->_tooltip = 'Business Partner'.

       p_replacement_bee = lr_text_bee.

endcase.

let me know if you have further queries.

Thanks & Regards,

Srinivas.

Former Member
0 Kudos

RENDER_CELL_START method creates Tooltip for the cells in Table rows but not the table header.

former_member210661
Active Contributor
0 Kudos

Hi Anji,

table columns are can be provided by implementing IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS method.

please implement this method and provide which fields you want to display in your table view.

this is fixed  columns.

example :

DATA ls_column          TYPE tableviewcontrol.


   ls_column-columnname          = 'REF_NO'.

   ls_column-title               = 'Ref No'.              "#EC NOTEXT

   ls_column-width               = '30%'.

   ls_column-horizontalalignment = 'LEFT'.

   INSERT ls_column INTO TABLE p_column_definitions.


Thanks & Regards,

Srinivas.

Former Member
0 Kudos

Hi Srinivas,

My question was on providing tooltip when we point or move cursor over Header Column, then it should show tooltip. I have already impletemented the get_column_definitions method. thank you

Former Member
0 Kudos

Hi Anji,

GET_HEADER_BEES method of class CL_THTMLB_CELLERATOR is called to set tooltip of the header of table view.

See line 46 "lv_tooltip = <ls_column>-title." of the method.

To give another tooltip , you need to enhance 'GET_HEADER_BEES' method and change the default behaviour.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Anji,

Did the solution solved your issue??

Regards,

Ritu

Former Member
0 Kudos

Hi Ritu,

I havent implemented the changes. This will work but need to modify standard class based on the Page context ( so that we can update only where we wanted to change). I am also thinking of another way from .htm page.

I will try and update you once done.

Thank you

Anji

Former Member
0 Kudos

Hi Anji,

It would be much easier from htm page.

Below is the code to be written on .htm page to get the tooltip.

<%

DATA: lv_fieldname TYPE string,

       lv_field_col_no type string,

       lv_id1 type string,

       lv_id2 type string.

lv_fieldname = 'FACILITYID'.

lv_field_col_no = '1'.

CONCATENATE controller->component_id '_' lv_table_id '_col_' lv_field_col_no '-' lv_fieldname '-TH' INTO lv_id1.

CONCATENATE controller->component_id '_' lv_table_id '__header_bee__' lv_field_col_no INTO lv_id2.

%>

<script>

document.getElementById("<%= lv_id1 %>").setAttribute("title", "Field tooltip");

document.getElementById("<%= lv_id2 %>").setAttribute("title", "Field tooltip");

</script>

Below is the output:

Thanks,

Ritu

Former Member
0 Kudos

Thank you Ritu.

I tried with your .htm page code, still I am not getting the tooltip for my table view columns.

Former Member
0 Kudos

Hi Anji,

<%

DATA: lv_fieldname TYPE string,

       lv_field_col_no type string,

       lv_id1 type string,

       lv_id2 type string.

lv_fieldname = 'FACILITYID'.

lv_field_col_no = '1'.

CONCATENATE controller->component_id '_' lv_table_id '_col_' lv_field_col_no '-' lv_fieldname '-TH' INTO lv_id1.

CONCATENATE controller->component_id '_' lv_table_id '__header_bee__' lv_field_col_no INTOlv_id2.

%>

<script>

document.getElementById("<%= lv_id1 %>").setAttribute("title", "Field tooltip");

document.getElementById("<%= lv_id2 %>").setAttribute("title", "Field tooltip");

</script>

In the above code,

1. write your fieldname in lv_fieldname.

2. The column no of that particular field in your your table view in lv_field_col_no. For e.g. If you displaying 4 coulmns in your table view and want to change the tooltip of your 3rd column then write:

lv_field_col_no = '3'.


3. lv_table_id is your table view id. This you can get from 'id' attribute of the table view htm code.

4. Write all the above code after table view htm code as it will need table view id.


Check at debug time if lv_id1 attribute is something like:


                  C1_W1_V2_TableviewID_col_1-FACILITYID-TH

               (componentid_ tableview id_col_no_fieldname-TH)


Thanks,

Ritu

former_member198132
Active Participant
0 Kudos

Hi Anji reddy,

did  u solved this problem or not?

i Have the same issue.. Tried to implement the above codes, but not working.

can u provide me the solution what u did?

thanks

rama

Former Member
0 Kudos

Hi Rama,

I tried with changes to GET_HEADER_BEES method of class CL_THTMLB_CELLERATOR in debug mode and it worked. I haven't implemented the change yet.

The above changes mentioned by Ritu also works. Just check the correct Controller id.

Thank you

Anji

Former Member
0 Kudos

Hi Anji,

GET_HEADER_BEES method of class CL_THTMLB_CELLERATOR is called to set tooltip of the header of table view.

See line 46 "lv_tooltip = <ls_column>-title." of the method.

To give another tooltip , you need to enhance 'GET_HEADER_BEES' method and change the default behaviour.

Did the above solution solved your problem??

faisal_pc
Active Contributor
0 Kudos

Hi Anji,

I believe this can be achieved through the iterator class of your table view. Take the iterator class of your view. It will have a method called IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START. In this method, go to the case for your field. WHEN 'Field_name'. There is an attribute called 'TOOLTIP' for class CL_CRM_IC_LABEL. So take your field and give that label with custom field.

I haven't tried this yet. But as per me it should work for your purpose.

Thanks,

Faisal

Former Member
0 Kudos

Hi Anji,

Please define GET_P for your column in table view and you need to write the code

case iv_property

when if_bsp_wd_view_descriptor_tooltip ( tooltip)

   rv_value = 'Too;tip  text'.

endcase.

please put a break point in GET_P method to understand exact functionality and required variables declaration in GET_P

Regards,

GSS CRM

Former Member
0 Kudos

GET_P method changes works only for the Table cell value, not for the Table header column.

Former Member
0 Kudos

HI

Add the iterator to the html page tags anduse if_thtmlb_tableview_itearator interface to create se24 class and redefine the method get_column_definitions..it may work..