on 08-03-2004 9:22 AM
I've been playing around with this all morning, I have an Iterator for my tableView and I would like to add a refresh image to one of the column headers.
What I have been trying to use the DISPLAY_BEE property of the columndefintion
In the "IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS" here is what I'm trying.
DATA: colhead_bee TYPE REF TO CL_BSP_BEE_TABLE.
DATA: txt TYPE REF TO CL_HTMLB_TEXTVIEW.
DATA: image TYPE REF TO CL_HTMLB_IMAGE.
image = cl_htmlb_image=>factory( id = 'mnu_refresh'
src = '@42@'
alt = 'Refresh'
onClick = 'myConfirmAlert' ).
txt = cl_htmlb_textView=>FACTORY( text = 'Status' ).
CREATE OBJECT seats_bee.
colhead_bee->ADD( image ).
colhead_bee->ADD( txt ).
APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
<def>-COLUMNNAME = 'STATUS'.
<def>-TITLE = 'Status'.
<def>-WIDTH = '10%'.
<def>-SORT = 'X'.
<def>-DISPLAY_BEE = colhead_bee.
But I get no error and no image, is it even possible and if so am I barking up the wrong tree?
I checked the SBSPEXT_TABLE example but I didn't see maybe I missed it where someone has done something similiar??
Hello Craig,
I've met similar requirements and I could implement them via enhancing CL_THTMLB_CELLERATOR => GET_HEADER_BEES, where I change the ET_HEADER.
Need to note, i'm on SAPK-73105INWEBCUIF, CRM 7.0 EHP2.
One can see the code of the method and note down that BEEs and even Toltip do not play any role as they are redefined again.
My post may come to late, but I hope it will be useful for others.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In principle the display bee is used to render each cell the same for this column. It is not possible to custom render the header itself. (There are powers that does not want that:). Also looks slightly silly. Why not set a nice tooltip to just explain the icons.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
just believe Steffen, because he is the real tableview expert
in our group.
Regards,
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Craig,
A while back, I tried it just like Brian's weblog on tableview iterator. Maybe that will help you.
Just an excerpt from his weblog, which is 'slightly' different than yours:
WHEN 'ICON'.
DATA: icon_plane TYPE STRING.
icon_plane = CL_BSP_MIMES=>SAP_ICON( id = 'ICON_WS_PLANE' ).
p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY( id = p_cell_id src = icon_plane ).
By the way, some weblog has very small font so it hard to read, tableview iterator and BEE are the one I found, maybe if Brian read this, he'll fix it for us TIA Brian
Regards,
Iwan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank Iwan, however the problem I have is that I'd like to modify the column header, the code excerpt is how you modify the content of the column itself.
For example in Brian's code when he comes the column called 'ICON' he enter's a the "image icon" as the value for the column. Which works perfectly, except I want the column header to show the icon as well.
I thought using the DISPLAY_BEE field for the column defintion was correct but I don't get the image only the text.
Hi Craig,
You should see at least an image for each row on screen.
I've tried the following:
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003">
<htmlb:page>
<htmlb:form>
<%
data iterator type ref to cl_sdn_iterator.
create object iterator.
data sflight TYPE FLIGHTTAB.
select * from sflight into table sflight.
%>
<htmlb:tableView id = "test"
iterator = "<%=iterator %>"
table = "<%=sflight %>"
visibleRowCount = "8">
</htmlb:tableView>
</htmlb:form>
</htmlb:page>
</htmlb:content>
method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
DATA: colhead_bee TYPE REF TO CL_BSP_BEE_TABLE.
DATA: txt TYPE REF TO CL_HTMLB_TEXTVIEW.
DATA: image TYPE REF TO CL_HTMLB_IMAGE.
field-symbols <def> like line of P_COLUMN_DEFINITIONS.
image = cl_htmlb_image=>factory( id = 'mnu_refresh'
src = '@42@'
alt = 'Refresh'
onClick = 'myConfirmAlert' ).
txt = cl_htmlb_textView=>FACTORY( text = 'Status' ).
CREATE OBJECT colhead_bee.
colhead_bee->ADD( image ).
colhead_bee->ADD( txt ).
APPEND INITIAL LINE TO P_COLUMN_DEFINITIONS ASSIGNING <def>.
<def>-COLUMNNAME = 'STATUS'.
<def>-TITLE = 'Status'.
<def>-WIDTH = '10%'.
<def>-SORT = 'X'.
<def>-DISPLAY_BEE = colhead_bee.
endmethod.
Unfortunately, in general, it isn't possible to manipulate the header - only cell content can be replaced by a bee.
Best wishes,
Steffen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Steffen,
That is what I was coming to the conclusion of is that the column header can't be modified. Be a nice feature for the future though. Techincally it can't be much different than the <def>-SORT = 'X' where the two small arrow images appear.
As for showing an image in each row, that is no problem at all.
I have been fighting, sorry playing around using Brian's weblog <a href="/people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees">BSP Programming: BSP Element Expressions (BEEs)</a>
The result - kaput!
Suggestions or was Steffen correct and this is just not possible?
> The result - kaput!
Ok, email me the source of the iterator class, and the data table you want to render. Simple example. I will fix it, and you can then append it here. This way we get some working examples of usage of iterators.
I never did publish the complete source for the iterators weblog (don't even know if I have it still). For new weblogs, I have now the possibility to link to .TXT file with all source. Should I do try to find and publish the complete code of weblog?
Hi Craig,
Try this:
data:
imgsrc type string value 'src="http://www.google.it/intl/it_it/images/logo.gif"',
onclickcode type string value 'onClick="javascript:alert(''Test'');"'
.
<htmlb:tableView id = "test"
table = "<%=sflight %>"
visibleRowCount = "8">
<htmlb:tableViewColumn columnName = "STATUS"
sort = "NONE"
title = "<img <%=imgsrc%> <%=onclickcode%>> Status" />
<htmlb:tableViewColumn columnName = "FIELD1"
sort = "NONE"
title = "Field One" />
</htmlb:tableView>
It is surely less flexible than your solution, but more simple.
Dany
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.