cancel
Showing results for 
Search instead for 
Did you mean: 

rendering check box and input field.

Former Member
0 Kudos

experts,

I rendered checkbox and input fields in table view and data is storing well into the tables.

when display the same data the check boxes are not checked which have value 'X'. and also the text in input field also not visible.

help me in this regard.

Thanks

vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

raja_thangamani
Active Contributor
0 Kudos

Post your code here including Iterator code if u r using.

Raja T

Former Member
0 Kudos

Hi Raja,

<u><b>TableView</b></u>

  
<htmlb:tableView   id             = "TV"
                           table          = "<%= controller->int_table %>"
                           design         = "ALTERNATING"
                           onRowSelection = "MyEventRowSelection"
                           selectionMode  = "MULTILINEEDIT"
                           filter         = "SERVER"
                           visibleRowCount = "12"
                           columnWrapping      = "TRUE"
                           iterator            = "<%= controller %>" 

<b><u>Iterator Coding</u></b>

<b><u>get_column_definitions</u></b>


method if_htmlb_tableview_iterator~get_column_definitions.


    field-symbols: <def> like line of p_column_definitions.



    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'VENDOR'.
    <def>-title = 'Vendor'.
    <def>-edit = ''.
    <def>-horizontalalignment = 'left'.
    <def>-width = '240'.


    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'VENDORID'.
    <def>-title = 'ID'.
    <def>-edit = ''.
    <def>-horizontalalignment = 'left'.
    <def>-width = '90'.

    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'CONTRACT'.
    <def>-title = 'Contract'.
    <def>-edit = ''.
    <def>-horizontalalignment = 'left'.
    <def>-width = '90'.

    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'STATUS'.
    <def>-title = 'Status'.
    <def>-edit = 'X'.
    <def>-horizontalalignment = 'left'.
    <def>-width = '60'.

    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'REF_CODE'.
    <def>-title = 'Reference Code'.
    <def>-edit = 'X'.
    <def>-horizontalalignment = 'left'.
    <def>-width = '120'.
append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'INCLUDE_EXCLUDE'.
    <def>-title = 'Include/Exclude'.
    <def>-edit = 'X'.
    <def>-horizontalalignment = 'left'.
    <def>-width = '100'.


    append initial line to p_column_definitions assigning <def>.
    <def>-columnname = 'JUSTIFICATION'.
    <def>-title = 'Justification'.
    <def>-edit = 'X'.
    <def>-horizontalalignment = 'left'.
    <def>-width = '240'.

m_row_ref type ref to int_table.(class attribute)

<b><u>render_row_start</u></b>


method if_htmlb_tableview_iterator~render_row_start.

  m_row_ref ?= p_row_data_ref.
endmethod.

<u><b>render_cell_start.</b></u>



method if_htmlb_tableview_iterator~render_cell_start.
data: just type string.
  case p_column_key.
   when 'INCLUDE_EXCLUDE'.
   if p_edit_mode is not initial.
      p_replacement_bee = cl_htmlb_checkbox=>factory(
                            id                = p_cell_id ).
                               endif.

when 'JUSTIFICATION'.
     just = m_row_ref->justification.
     p_replacement_bee = cl_htmlb_inputfield=>factory( id = p_cell_id 
                                                                           type = 'STRING'
                                                                              size = '60' ).                                                                                
endcase.

Thanks

Vijay

raja_thangamani
Active Contributor
0 Kudos

Vijaykumar,

You need to pass the values to checkbox & Inputfield:

For example:

date = m_row_ref->SDATE.
p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
                      id        = p_cell_id
                       value     = date
                       type      = 'DATE'
                         showHelp  = 'TRUE'
                         cellValue = 'TRUE' ).

same way for Checkbox too:

p_replacement_bee = CL_HTMLB_CHECKBOX=>FACTORY
( id = p_cell_id
checked = m_row_ref->ACTV_FLAG ).

Modify your code based the fieldname.

Raja T

raja_thangamani
Active Contributor
0 Kudos

Reply/Reward/Close the thread if your issue is resolved.

Raja T