on 08-17-2004 1:06 PM
Hello,
can somebody help me?!
Situation:
Ive an internal table decisiontab with three fields.
zmoppid
zmdeciflag (X or space)
deci_image (s_s_ledg.gif or s_s_ledr.gif) -> dependent of zmdeciflag
[The images are in my application (mimes)]
I want to create a TableView on my bsp with a checkbox for zmdeciflag. The checkbox should be capable for editing.
Example for the internal table:
zmoppid zmdeciflag deci_image
100400 X s_s_ledg.gif
100401 s_s_ledr.gif
One of my test-code: (layout)
[code]
<htmlb:tableView id = "decisiontab"
headerText = "Decision View"
headerVisible = "true"
table = "<%= decisiontab %>"
visibleRowCount = "15"
onHeaderClick = "MyEventHeaderClick"
onRowSelection = "MyEventRowSelection"
sort = "SERVER"
design = "alternating"
selectionMode = "lineedit" >
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName="zmoppid" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "zmdeciflag"
edit = "true"
type = "user" >
<htmlb:checkbox checked="$ZMDECIFLAG$" >
</htmlb:checkbox>
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "deci_image"
type = "image" >
<htmlb:image id = "deci_image"
src = "$DECI_IMAGE$" />
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
[/code]
Result: The page can not display.
[code]
<htmlb:tableView id = "decisiontab"
headerText = "Decision View"
headerVisible = "true"
table = "<%= decisiontab %>"
visibleRowCount = "15"
onHeaderClick = "MyEventHeaderClick"
onRowSelection = "MyEventRowSelection"
sort = "SERVER"
design = "alternating"
selectionMode = "lineedit" >
<htmlb:tableViewColumns>
<htmlb:tableViewColumn columnName="zmoppid" >
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "zmdeciflag"
type = "user" >
<htmlb:checkbox checked="$ZMDECIFLAG$" >
</htmlb:checkbox>
</htmlb:tableViewColumn>
<htmlb:tableViewColumn columnName = "deci_image"
edit = "true"
type = "image" >
<htmlb:image id = "deci_image"
src = "s_s_ledg.gif" />
</htmlb:tableViewColumn>
</htmlb:tableViewColumns>
</htmlb:tableView>
[/code]
Result:
In this case Ive set deci_image always s_s_ledg.gif and the page can display.
But this is not what I want.
An other problem:
When I choose one line in the column zmdeciflag, just the checkbox in the first line change their activity and not that one, which I choose.
Resume - two problems:
1. Display two different images (dependent from an other field) in a TableView
2. Change more then the fist line in a TableView
Does anybody know about this problem.
Thanks for any advice or path for more information.
Kind Regards
Petra
Hi Petra,
the $$ replacement technique is rather old and won't be supported anymore (at least in Design2003). Sometimes it works, sometimes not.
Why don't you use a tableview iterator instead of the htmlb:tableviewColumn tags and the $$ replacements?
Just search in this forum for "Tableview Iterator" and/or read the blogs by Brian:
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
/people/brian.mckellar/blog/2003/10/30/bsp-programming-bsp-element-expressions-bees
and you will see a really nice technique to render a tableview. Try it. If you have problems you will always find a helping hand in this forum.
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 Petra,
This will take you through the tableView Iterator quite nicely, <a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator">BSP Programming: HTMLB TableView Iterator</a>
Oh and for the code formating it's a [_code] and [_/code] without the _
Here is what I did in the IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START of the Iterator.
* Data Declarations
DATA: dataValue TYPE STRING,
tmp TYPE STRING,
tmptext TYPE STRING.
CASE p_column_key.
WHEN 'STATUS'.
dataValue = m_row_ref->STATUS.
case dataValue.
when ''.
tmp = '@5B@'.
tmptext = m_row_ref->STATUST.
when 'C'.
tmp = '@5B@'.
tmptext = m_row_ref->STATUST.
when 'D'.
tmp = '@5D@'.
tmptext = m_row_ref->STATUST.
when 'E'.
tmp = '@5C@'.
tmptext = m_row_ref->STATUST.
endcase.
DATA: image TYPE REF TO CL_HTMLB_IMAGE.
p_replacement_bee = cl_htmlb_image=>factory( id = 'img'
src = tmp
alt = tmptext ).
ENDCASE.
That bit of code outputs an image in place of the cell content for me.
Hi Craig, hi Rainer,
thanks for your very helpful informations.
My TableView looks now in such a way, as I presented it to me.
Now I have a new problem with the inquiry of the inputs. For this I open a new topic because the actual problem is solved.
Kind regards
Petra
Message was edited by: Petra Adomeit
Message was edited by: Petra Adomeit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.