on 07-10-2007 9:46 AM
Hi all,
here's the thing: I'm trying to add an image column to a tableview but it doesn't work (there's no error, but the image doesn't appear). I've tried it with an iterator.
Page Layout:
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design = "design2003"
controlRendering = "SAP" >
<htmlb:document>
<htmlb:documentHead>
</htmlb:documentHead>
<htmlb:documentBody>
<htmlb:form>
<htmlb:tableView id = "tableview_scarr"
table = "<%= pa_tab_scarr %>"
headerText = "Table SCARR"
headerVisible = "TRUE"
iterator = "<%= application %>" >
</htmlb:tableView>
<%
IF page->messages->num_messages( ) > 0.
%>
Error
<%
ENDIF.
%>
</htmlb:form>
</htmlb:documentBody>
</htmlb:document>
</htmlb:content>
OnInitialization:
SELECT * FROM scarr INTO TABLE pa_tab_scarr.
My application class is my iterator. It implements GET_COLUMN_DEFINITIONS:
METHOD if_htmlb_tableview_iterator~get_column_definitions.
DATA tv_column TYPE tableviewcontrol.
tv_column-columnname = 'SHOW_ICON'.
tv_column-title = 'SHOW_ICON'.
tv_column-encode = 'X'.
tv_column-width = '100'.
APPEND tv_column TO p_column_definitions.
CLEAR tv_column.
tv_column-columnname = 'CARRID'.
tv_column-width = '100'.
APPEND tv_column TO p_column_definitions.
ENDMETHOD.
...and it implements RENDER_CELL_START:
METHOD if_htmlb_tableview_iterator~render_cell_start.
CASE p_column_key.
WHEN 'SHOW_ICON'.
DATA col_image TYPE REF TO cl_htmlb_image.
CREATE OBJECT col_image.
col_image->src = "@2N@".
col_image->width = '16'.
col_image->height = '14'.
p_replacement_bee = col_image.
ENDCASE.
ENDMETHOD.
I've checked the SICF, but all services concerning icons are activated. This is my first Iterator so i'm not sure if i've forgotten something. Why the image is not shown?
Regards
Mark-André
DATA: icon_plane TYPE string.
icon_plane = cl_bsp_mimes=>sap_icon( id = 'ICON_WS_PLANE' ).
and now icon_pane to src property fo the image
DATA col_image TYPE REF TO cl_htmlb_image.
CREATE OBJECT col_image.
col_image->src = icon_plane .
col_image->width = '16'.
col_image->height = '14'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
First of all, define an object named iterator in page attributes type ref to iterator_class_name
i.e
iterator TYPE REF TO ZCL_ITERATOR(or iterator_class_name)
Then in <b>onInitialization</b> use
create object iterator.
Also you can use any name of the iterator object...but the name application is reserved for the application class....
So your tableView code will be
<htmlb:tableView id = "tableview_scarr"
table = "<%= pa_tab_scarr %>"
headerText = "Table SCARR"
headerVisible = "TRUE"
iterator = "<%= iterator %>" >
Rest all is fine...!!
Hope this helps.
<b><i>Do reward each useful answer..!</i></b>
Thanks,
Tatvagna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.