on 10-31-2008 8:58 AM
Hi Experts,
I have a requirement in which i have a tableview displaying Opportunity Result View in my Zcomponent, and we want to display a particular row in that tableview in Italics/Red/Bold depending upon some particular type of opportunity.
Plz guide me on how to proceed with this. It would be of great help if some sample code can be put here. Do we have to use concept of iterator/CSS for the same?
I am using following code to display my tableview:
<chtmlb:tableExtension tableId = "ResultList"
layout = "FIXED" >
<chtmlb:configTable xml = "<%= lv_xml %>"
id = "Table"
navigationMode = "BYPAGE"
onRowSelection = "select"
table = "//Result/Table"
width = "100%"
hasLeadSelection = "TRUE"
visibleRowCount = "<%= lv_lines %>"
actions = "<%= controller->gt_button %>"
actionsMaxInRow = "4"
selectionMode = "<%= Result->SELECTION_MODE %>"
selectedRowIndexTable = "<%= Result->SELECTION_TAB %>"
selectedRowIndex = "<%= Result->SELECTED_INDEX %>"
visibleFirstRow = "<%= Result->visible_first_row_index %>"
showNoMatchText = "FALSE"/>
</chtmlb:tableExtension>
Regards,
Rohit
Hello,
you are right. You need to use an iterator.
Implement interface IF_HTMLB_TABLE_VIEW_ITERATOR in one of your classes (context node or view cotroller) and specify the attribtue: ITERATOR in the tableView tag.
cheers Carsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
it is true that you should be using an HTMLB tag for rendering. the LINK class is the most suitable. As for all I know it renders the link according to the linkType you specify. It is either DEFAULT, FUNCTION, REPORTING, RESULT, DRAGRELATE. See the BSP Tag Library in SE80 for details.
What could be a possibility is that the tags work on CSS style sheets. Maybe you can specify the correct style around the tag.
Meaning: use the BEE table tag you used before.
First put the CSS in there that is used by the LINK tag. Second insert the LINK tag.
Another possibility is to create a copy of the LINK tag classes and adjust them to render the link as you desire. Then in the iterator return the tag you created.
cheers Carsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carsten,
Finally i achieved it using CL_HTMLB_LINK instead of CL_THTMLB_LINK!!!
Really thankful for your suggestions and pointers.
But, i could not fully understand how to go about using CSS and thtmlb for the same.
It will be great if you could put up some example or sample code, have gone though a few tags in SE80, but could not quite get what i want.
Thanks again for your valuable inputs.
Regards,
Rohit
No Replies!!!
Well, after much debugging, i am seeing that the text returned for my navigation link is of the class type CL_THTMLB_LINK, which does not have any attribute of color, and if i pass this line to its text attribute of factor method, it doesnt work, instead it comes as text in output:
concatenate '<font color="RED"><i>' col_img_str '</i></font>' into col_img_str .
p_replacement_bee = CL_THTMLB_LINK=>factory(
id = p_cell_id
text = col_img_str
ON CLICK = 'opdetail' ).
whereas the similar code work if i use this code:
p_replacement_bee = cl_htmlb_textview=>factory(
id = p_cell_id
text = col_img_str ).
but the problem is that htmlb class does not have ONCLICK attribute necessary for navigation, so does that mean that we can not change font properties of navigation link text????
Please help.
Regards,
Rohit
Edited by: Rohit Khetarpal on Nov 5, 2008 1:38 PM
Edited by: Rohit Khetarpal on Nov 5, 2008 1:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
as said: Implement the interface.
There is a method RENDER_CELL_START in it. Here you can set what the content of each and every cell should be and what it should look like.
You could for instance use the <htmlb:textView> tag to view a text. I once used a tag that allowed me to put a whole table or any kind of html into a table cell, do not remember the name right not.
Maybe if you did a where used list on the interface I gave you, you would have had a look at this example: CL_BT120H_C_TASKLISTOV_IT.
cheers Carsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carsten,
Thanks for giving pointers.
I tried the example you mentioned, and also few other examples. What i got is they are adding some image (like Green Icon) in front of a field in tableview or making some field checkbox/dropdown.
But i did not get any example where i can change the font of the existing entry in a tableview without changing its properties (like navigation).
I can use following code to change it:
ASSIGN COMPONENT p_column_key OF STRUCTURE <fs> TO <l_field>.
wf_text = <l_field> .
concatenate '<font color="RED">' wf_text '</font>' into wf_text .
p_replacement_bee = cl_htmlb_textview=>factory(
id = p_cell_id
text = wf_text ).
but it will remove its property of navigation, and only text will come.
and i can use:
CREATE OBJECT bee_hive.
bee_hive->add_bee( bee = col_img ).
bee_hive->add_bee( bee = config_content ).
p_replacement_bee = bee_hive.
to add anything in front of my text.
Please guide how to change the font of existing entry of tableview, i am completely stuck.
Regards,
Rohit Khetarpal
Edited by: Rohit Khetarpal on Nov 4, 2008 4:05 PM
Hi Rohit,
I don't think it will be possible though html code. Because you dont have any tag in table to change the font color or style. You can do the same on other field you create using html code but not on table.
Again my understanding can be limited because there is nothing impossible in SAP ). Good luck.
Best regards
Pankaj Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
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.