cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a Breadcrumb image inside a Table view column

Former Member
0 Kudos

Hi

I want a sample code to call any bread crumb related image inside a table view column.

Please help with a code snippet.

Accepted Solutions (1)

Accepted Solutions (1)

athavanraja
Active Contributor
0 Kudos

can you explain a bit more? what do you mean by breadcrumb related image?

Regards

Raja

close/reply/reward point sto your earlier thread

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks

Former Member
0 Kudos

You can use this code in RENDER_CELL_START method of iterator class to display a Set State image in a table view column.

p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(
                              id        = p_cell_id
                              src      = '@3J@'  ).

Regards,

Ravikiran.

Former Member
0 Kudos

Can you please send me a code snippet for the same

I am unable to make out how to use this code which you have written.

Regards

Bhavana Advani

Former Member
0 Kudos

I mean that, inside the iterator class of the tableView, write this code in the RENDER_CELL_START method.

method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.


  CASE p_column_key.

    WHEN 'ICON'.

p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(       id        = p_cell_id                              src      = '@3J@'  ).
    

    ENDCASE.

Inside the method, GET_COLUMN_DEFINITIONS you need to append a column for icon, see the code below:

APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-COLUMNNAME = 'ICON'.
    <def>-TITLE      = 'Display Icon'.

For more info you can refer to weblog on HTMLB TableView Iterator by Brian.

Hope I am clear.

Regards,

Ravikiran.C

Former Member
0 Kudos

HI Ravikiran

The issue here is that the icon has to change each time for a different row depending on priority of the ticket.

For the same how do i implement this.?

Also please let me know what will be written in layout ; oninput processing so that the coding is clear on this end.

Regards

Bhavana Advani

Former Member
0 Kudos

If you go through the weblog specified by me in the previous post, you will get full idea of Table View Iterator.

/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

Coming to your question, if you want to have different icons upon different conditions, that is also possible. The code below will show one icon when flag = '1' and other icon when flag = '0'.

CASE p_column_key.
 
WHEN 'ICON'.

IF FLAG = '1'.


p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(
                              id        = p_cell_id
                              src      = '@3J@'  ).

ELSEIF FLAG = '0'.

p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(
                              id        = p_cell_id
                              src      = '@01@'  ).

ENDIF.

ENDCASE.

Regards,

Ravikiran.

PS: Assign points for replies which you find helpful.

Former Member
0 Kudos

HI ravikiran

I understand from the weblogs that all these conditions would be loaded in OnInput processing of the page but no where in the weblog they have given a clear picture of how the Layout would look.

PLease help on the same .

Regards

Bhavana Advani

Former Member
0 Kudos

If you want to just display an icon in the table view cell depending upon some condition, then you don't need to have anything in the OnInputProcessing event handler.

If you are going to edit some cells in the table view, then only you require to handle onInputProcessing event.

Coming to the layout, on how it looks like, it will have a status icon appended as the first column of the table view.

Hope I am clear.

Regards,

Ravikiran.

Former Member
0 Kudos

HI Ravikiran

Just to display DIFFERENT icons in the table view cell depending upon some condition , do u need to use TAble view iterators. If no then what is the alternative solution.

PLease help

Regards

Bhavana Advani

Former Member
0 Kudos

If you need just to display different icons, you can do it with iterator. If you dont want to go through that way you do as below in layout:

</htmlb:tableViewColumn>
           <htmlb:tableViewColumn 
           columnName          = "myicon"
           title               = "Image"
           horizontalAlignment = "center" >
           <htmlb:image src     = "<%= CL_BSP_MIMES=>SAP_ICON( id = '@9S@' ) %>"/>
   </htmlb:tableViewColumn>

Refer <b>SBSPEXT_HTMLB</b> for further help.

Dont forget to award points, if you find the reply helpful.

Regards,

Ravikiran.

Former Member
0 Kudos

The problem over here is that if i loop at the layout and depending on different conditions i display different images , the problem that occurs is all the images are shown in one column itself.

HOw do i make it go to the next line ?