on 10-01-2008 4:58 AM
Hi ,
Below is the code of IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START:
WHEN 'DATE' .
IF p_edit_mode IS NOT INITIAL.
DATA: dateon TYPE REF TO cl_htmlb_inputfield .
dateon = cl_htmlb_inputfield=>factory( id = p_cell_id id_postfix = '_sixth'
type = 'date'
showhelp = 'X').
p_replacement_bee = dateon.
dateon->value = m_row_ref->date.
ENDIF.
How can i add JS validation for checking that the date is Equall to or Less than current date..for the inputfield above..
Any clue will be of great help...
Thanks,
Anubhav.
Edited by: Anubhav Jain on Oct 1, 2008 12:31 PM
in the IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START method add the following code.
data: v_cel_val type string.
WHEN 'DATE' .
IF p_edit_mode IS NOT INITIAL.
ONCATENATE 'javascript:CheckDate(' m_row_ref->date ')' into v_cel_val.
DATA: dateon TYPE REF TO cl_htmlb_inputfield .
dateon = cl_htmlb_inputfield=>factory( id = p_cell_id id_postfix = '_sixth'
type = 'date'
value = m_row_ref->date
onClientClick = v_cel_val
showhelp = 'X').
p_replacement_bee = dateon.
dateon->value = m_row_ref->date.
ENDIF.
Now in layout, you can write the date validation check in JS CheckDate() function. Google to get the date check javascript code.
Hope this will solve your problem.
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try below code. It should work.
data: v_cel_val type string.
WHEN 'DATE' .
IF p_edit_mode IS NOT INITIAL.
ONCATENATE 'javascript:CheckDate(' m_row_ref->date ')' into v_cel_val.
p_replacement_bee = cl_htmlb_inputfield=>factory(
id = p_cell_id
MAXLENGTH = '12'
size = '12'
WIDTH = '80'
value = m_row_ref->date
type = 'date'
onClientClick = v_cel_val
showhelp = 'X'
cellvalue = 'TRUE' ).
Raja
Hi Raja,
Found the code ;
method if_htmlb_tableview_iterator~render_cell_start .
data: o_fr type ref to cl_bsp_find_and_replace,
o_ip type ref to cl_htmlb_inputfield,
o_bee type ref to cl_bsp_bee_table.
data: find type string.
data: replace type string.
data: rowno type string ,
columnno type string ,
tvid type string .
clear: find, replace .
case p_column_key.
when 'CARRID'.
clear : rowno, columnno, tvid .
split p_cell_id at '_' into tvid rowno columnno .
find = '< i n p u t ' .
replace = `< i n p u t o n C h a n g e = " j a v a s c r i p t : a l e r t ( t h i s. n a m e ) ; " ` .
o_fr = cl_bsp_find_and_replace=>factory( find = find
replace = replace
mode =
`FIRST_OCCURRENCE` ).
o_ip = cl_htmlb_inputfield=>factory( id = p_cell_id ).
create object o_bee.
o_bee->add( level = 1 element = o_fr ).
o_bee->add( level = 2 element = o_ip ).
p_replacement_bee = o_bee.
endcase .
endmethod.
in a previous post by Durairaj.
Thanks for the help,
Anubhav.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.