on 11-17-2014 5:48 PM
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.
ID | Name |
---|---|
1 | ABC |
2 | DEF |
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
Hi Anji,
Did the solution solved your issue??
Regards,
Ritu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.