on 11-17-2004 4:45 PM
Have you ever tried to add an htmlb:image to a htmlb:tableView using an iterator?
I just did that and it workek fine until I added a onClientClick to the image. Then, when I open the page, I get a JavaScrip-Error "Syntax Error". After one of these errors per line, the page and the onClientClick works perfectly.
Is it a error in the framework or am I doing something wrong. this is my code (a bit complicated, hope you understand it)
METHOD if_htmlb_tableview_iterator~render_cell_start .
DATA lorv_image TYPE REF TO cl_htmlb_image.
DATA lorv_link TYPE REF TO cl_htmlb_link.
DATA lorv_bee_table TYPE REF TO cl_bsp_bee_table.
DATA lv_msg_id TYPE string.
FIELD-SYMBOLS: <fs_row> TYPE itsm_webstruc.
ASSIGN p_row_data_ref->* TO <fs_row>.
CASE p_column_key.
WHEN 'MNUMM_T'.
CONCATENATE <fs_row>-csinsta
<fs_row>-mnumm
<fs_row>-myear
INTO lv_msg_id.
CREATE OBJECT lorv_link.
CONCATENATE p_tableview_id
lv_msg_id
INTO lorv_link->id.
lorv_link->text = <fs_row>-mnumm_t.
lorv_link->onclick = 'show_message'.
CREATE OBJECT lorv_image.
lorv_image->src = 'ICON_OKAY'.
lorv_image->onclientclick = 'alert( )'. "it works without this line!
CREATE OBJECT lorv_bee_table.
lorv_bee_table->add( lorv_link ).
lorv_bee_table->add( lorv_image ).
p_replacement_bee = lorv_bee_table.
ENDCASE.
ENDMETHOD.
This is just a shot in the dark. I have used the image in an iterator before with the onClick - not onClientClick. Have you tried giving your htmlb:image an ID. I always assign the cell id to any inner htmlb elements in my iterator.
lorv_image->id = p_cell_id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using quite a lot of javascripts with pre-rendered elements in my iterator, and all errors I found in development where caused by me
What SP are you on?
Have you tried to look at the html source code in your browser, specifically the line that the javascript error occurs?
Maybe this is the next step towards solving your problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.