on 09-19-2007 12:38 PM
Hi,
I have created an inputfield with a f4-button.
If the button is clicked a javascript function shall be called.
The function has an input parameter.
I tried thid but it doesn't work. I think that the error is located in the last line when
I try to call the function.:
<htmlb:inputField id = "descr_<%= lv_counter %>"
value = "<%= ls_comp-task_descr %>"
maxlength = "40"
submitOnEnter = "FALSE"
showHelp = "X"
onValueHelp = "call_f4_help('descr_' + <%= lv_counter %>);" />
can you help me?
Best regards
Alberto
Hi Alberto,
I guess that there is some issue with the ID not fitting. Therefor I'd suggest the following:
Define 2 variables on top of your view/page:
data: lv_id type string,
lv_script type string.
Insert directly before your inputfield the following:
<% lv_id = lv_counter.
condense lv_id no-gaps.
concatenate 'descr' lv_id into lv_id.
concatenate 'call_f4_help("' lv_id '");' into lv_script. %>
And change the inputfield to:
<htmlb:inputField id = "<%=lv_id%>"
value = "<%= ls_comp-task_descr %>"
maxlength = "40"
submitOnEnter = "FALSE"
showHelp = "X"
onValueHelp = "<%=lv_script%>" />
There are 2 things you need to be aware of:
1. In case you use Controller + view do not use underscores in the ID's. Underscores are used to ensure unique ID's in case you use subcontroller.
2. In case you use that on a subcontroller you need in addition to the upper coding:
Change the controller class of the view to CL_BSP_CONTROLLER2.
Change the coding before the inputfield to
<% lv_id = lv_counter.
condense lv_id no-gaps.
concatenate 'descr' lv_id into lv_id.
"add the call to get the correct ID from the controller for the script
"the inputfield does this call automatically during rendering
lv_script = controller->get_id( lv_id ).
concatenate 'call_f4_help("' lv_script '");' into lv_script. %>
Hope that helps.
Best Regards
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
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.