Skip to Content
0
Former Member
Nov 16, 2005 at 09:49 AM

Making htmlb:listbox bindable by new BSP-Element

20 Views

Hi,

I tried to built a new bsp element which renders a listbox and where the table attribute is bindable.

So far I declared the element listBoxBindable in my own BSP-Extension with the same atrributes as htmlb:listBox.

For Element content I marked 'empty'.

For More Options I marked 'User defined Validation' and 'No return of PAGE DONE...'.

In element-handler-class I copied the methods IF_BSP_ELEMENT~COMPILE_TIME_IS_VALID

IF_BSP_ELEMENT~RUNTIME_IS_VALID

from HTMLB:ListBox.

method if_bsp_element~do_at_beginning.


  resolve_model_binding( ).

  data: listbox type ref to cl_htmlb_listbox.
  listbox ?= cl_htmlb_listbox=>factory(
            id                          = me->id
            backgroundcolor             = me->backgroundcolor
            disabled                    = me->disabled
            encode                      = me->encode
            multiple                    = me->multiple
            nameofbackgroundcolorcolumn = me->nameofbackgroundcolorcolumn
            nameofkeycolumn             = me->nameofkeycolumn
            nameoftextcolorcolumn       = me->nameoftextcolorcolumn
            nameofvaluecolumn           = me->nameofvaluecolumn
            selection                   = me->selection
            selections                  = me->selections
            size                        = me->size
            table                       = me->table
            textcolor                   = me->textcolor
            width                       = me->width ).

  rc = co_element_done.


endmethod.
method resolve_model_binding.

  data: model_name type string.

* table
  if _table is not initial.
    call method cl_bsp_model=>if_bsp_model_util~split_binding_expression
      exporting
        binding_expression = _table
      importing
        attribute_path     = m_table_path
        model_name         = model_name.

    m_table_model  = m_page_context->get_model( model_name ).
    table = m_table_model->get_attribute_data_ref( attribute_path = m_table_path ).
  endif.

endmethod.

<b>Unfortunately nothing is rendered - anybody an idea where I forgot something?</b>

Thx in advance!