Skip to Content
avatar image
Former Member

Table View Iterator and InputField(s)

Hi Group!

I was able to show 3 InputFields inside the Cell of a Table. To enable MODEL-BINDING I had to use the same p_cell_id for all the 3 InputFields, and this is causing problem. Is there a way to differentiate these 3 InputField IDs and the MODEL-BINDING works fine.

My code inside : IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START

*----


Start Date/Time/TimeZone -


WHEN 'PHASE_START_DATE'.

CREATE OBJECT lr_bee_table.

lr_bee_table->add_html( html = '<table width="100%">' ).

lr_bee_table->add_html( html = '<tr>' ).

  • InputField for Start Date

lr_bee_table->add_html( html = '<td width="45%">' ).

CREATE OBJECT lr_input.

lr_input->id = p_cell_id.

lr_input->value = <fs_phase>-phase_start_date.

lr_input->type = 'DATE'.

lr_input->showhelp = abap_true.

lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

lr_input->maxlength = '10'.

lr_input->submitonenter = abap_true.

lr_bee_table->add( lr_input ).

lr_bee_table->add_html( html = '</td>' ).

  • InputField for Start Time

lr_bee_table->add_html( html = '<td>' ).

CREATE OBJECT lr_input.

lr_input->id = p_cell_id.

lr_input->value = <fs_phase>-phase_start_time.

lr_input->type = 'TIME'.

lr_input->showhelp = abap_true.

lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

lr_input->maxlength = '10'.

lr_input->submitonenter = abap_true.

lr_bee_table->add( lr_input ).

lr_bee_table->add_html( html = '</td>' ).

  • InputField for Start Time Zone

lr_bee_table->add_html( html = '<td>' ).

CREATE OBJECT lr_input.

lr_input->id = p_cell_id.

lr_input->value = <fs_phase>-phase_start_timz.

lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

lr_input->maxlength = '10'.

lr_input->submitonenter = abap_true.

lr_bee_table->add( lr_input ).

lr_bee_table->add_html( html = '</td>' ).

lr_bee_table->add_html( html = '</tr>' ).

lr_bee_table->add_html( html = '</table>' ).

p_replacement_bee = lr_bee_table.

Thanks and Best Regards,

Bindiya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 22, 2007 at 04:42 AM

    Hi Bindiya,

    The variable p_cell_id has the value depending on the tableView id, row number and column no....

    Hence if your tableview id is

    'TV'

    , then the value of p_cell_id will be

    TV_row-no_col-no

    <i><b>i.e for 1st row 5th column it will be TV_1_5</b></i>

    Hence no two cells will have the same id....this way you will be able to differentiate between the inputField id's.....

    Hope this helps.

    <b><i>Do reward each useful answer..!</i></b>

    Thanks,

    Tatvagna.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Tatvagna,

      I do understand that no two cells have the same p_cell_id.

      In my case I am appending 3 InputFields inside one cell. How do we differentiate the 3 InputFields inside one cell ?

      Best Regards,

      Bindiya

  • avatar image
    Former Member
    Aug 22, 2007 at 06:53 AM

    Hi Bindiya,

    In that case, just try and concatenate p_cell_id with something...

    eg :

    data : lw_cell_id type string.
    
    concatenate p_cell_id `_1` to lw_cell_id.
    concatenate p_cell_id `_2` to lw_cell_id.
    concatenate p_cell_id `_3` to lw_cell_id.
    

    then for the 1st Row, 5th Column, the Id will be <b>TV_1_5_1, TV_1_5_2, TV_1_5_3</b> etc....!

    Hope this helps.

    <b><i>Do reward each useful answer..!</i></b>

    Thanks,

    Tatvagna.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Tatvagna,

      I got the solution and its working fine.

      I have modified my code as below:

      *----


      Start Date/Time/TimeZone -


      WHEN 'PHASE_START_DATE'.

      **************************************************************

      • Get the Head and Tail of Cell ID

      **************************************************************

      SPLIT p_cell_id AT '.' INTO lv_cell_id_head lv_cell_id_tail.

      • Append 3 InputFields into a Table

      CREATE OBJECT lr_bee_table.

      lr_bee_table->add_html( html = '<table width="100%">' ).

      lr_bee_table->add_html( html = '<tr>' ).

      • InputField for Start Date

      lr_bee_table->add_html( html = '<td width="45%">' ).

      CREATE OBJECT lr_input.

      lr_input->id = p_cell_id.

      lr_input->value = <fs_phase>-phase_start_date.

      lr_input->type = 'DATE'.

      lr_input->showhelp = abap_true.

      lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

      lr_input->maxlength = '10'.

      lr_input->submitonenter = abap_true.

      lr_bee_table->add( lr_input ).

      lr_bee_table->add_html( html = '</td>' ).

      • InputField for Start Time

      lr_bee_table->add_html( html = '<td>' ).

      CREATE OBJECT lr_input.

      **************************************************************

      • CONCATENATE lv_cell_id '.' 'phase_start_time' INTO lr_input_id.

      **************************************************************

      lr_input->id = zcl_zxa_str=>conc( iv_1 = lv_cell_id_head iv_2 = '.' iv_3 = 'phase_start_time' ).

      lr_input->value = <fs_phase>-phase_start_time.

      lr_input->type = 'TIME'.

      lr_input->showhelp = abap_true.

      lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

      lr_input->maxlength = '10'.

      lr_input->submitonenter = abap_true.

      lr_bee_table->add( lr_input ).

      lr_bee_table->add_html( html = '</td>' ).

      • InputField for Start Time Zone

      lr_bee_table->add_html( html = '<td>' ).

      CREATE OBJECT lr_input.

      **************************************************************

      • CONCATENATE lv_cell_id '.' 'phase_start_timz' INTO lr_input_id.

      **************************************************************

      lr_input->id = zcl_zxa_str=>conc( iv_1 = lv_cell_id_head iv_2 = '.' iv_3 = 'phase_start_timz' ).

      lr_input->value = <fs_phase>-phase_start_timz.

      lr_input->disabled = zcl_zrm_static=>get_logical_invert( iv_input = lv_is_user_allowed_to_edit ).

      lr_input->maxlength = '10'.

      lr_input->submitonenter = abap_true.

      lr_bee_table->add( lr_input ).

      lr_bee_table->add_html( html = '</td>' ).

      lr_bee_table->add_html( html = '</tr>' ).

      lr_bee_table->add_html( html = '</table>' ).

      p_replacement_bee = lr_bee_table.

      Thanks for your tip regaring modifying p_cell_id.

      Thanks and Warm Regards,

      Bindiya