Showing results for 
Search instead for 
Did you mean: 

Making htmlb:listbox bindable by new BSP-Element

Former Member
0 Kudos


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


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.

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
        binding_expression = _table
        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 ).


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

Thx in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Developer Advocate
Developer Advocate
0 Kudos

Just off the top of my head, I would say you are missing the rendering loop for the listbox.

Add the following after the method call to cl_htmlb_listbox=>factory.

    while m_page_context->element_process( element = listbox ) = co_element_continue.
    endwhile. "End Listbox Render

Former Member
0 Kudos

Oups forgotten

Answers (0)