Showing results for 
Search instead for 
Did you mean: 

How to bind data from model method to dropdownlistbox

Former Member
0 Kudos


Can anybody give the code for binding values from values of a method to a dropdownlistbox and how to bind a value from model to a radiobutton

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, i had the same problem (in editable table views too). In editable table views you need to use an internal table with field name key with "KEY" and value field name with "VALUE". Other names of key and value fields didn't work.

at least you use in view: nameOfKeyColumn = "KEY" and nameOfValueColumn = "VALUE".

Regards, Peter

Former Member
0 Kudos

Hi, I was wrong. The parameters nameOfKeyColumn and nameOfValueColumn can be all values. But the dropdown values must exists at views runtime (e.g. public table parameter in model instance). If you try this in an tableView you need to bind a data reference to the table:

*iterator class attributes
Data: PTPDSET_SEGM_DROPDOWN Instance Attribute Public Type SHSVALTAB
PDSET_SEGM_DROPDOWN Instance Attribute Public Type Ref To SHSVALTAB
*get reference in any one time called method
GET REFERENCE OF me->ptpay_method_dropdown INTO

Important is, that the parameter PTPDSET_SEGM_DROPDOWN must exists! (reference without data does'nt work.)

  CASE p_column_key.
*     sales group dropdown / Vertriebsgruppe Auswahldropdown
      l_char_for_numc = m_row_ref->pdset_key.
      p_replacement_bee = cl_phtmlb_combobox=>factory(
        id                = p_cell_id
        nameofkeycolumn   = 'KEY'
        nameofvaluecolumn = 'VALUE'
        enabled           = l_enabled
        selection         = l_char_for_numc
        table             = me->pdset_dropdown
        width             = '100' ).

greetings, Peter

Active Contributor
0 Kudos

<b>To Bind Dropdownlist:</b>

    <htmlb:dropdownListBox id                = "myID"
                           table             = "//model/itab"
                           selection         = "//model/selcted_value"
                           nameOfKeyColumn   = "dat_key"
                           nameOfValueColumn = "dat_value"
                           onSelect          = "DD_EVENT"
                           disabled          = "false" />

<b>For Radiobutton:</b>

<htmlb:radioButtonGroup id = "rg1" helpValues="//model/flight.carrid"/>

Hope this will help you..If you need more detail, get back to us..

  • Reard each helpful answer..

Raja T

Active Contributor
0 Kudos

If your issue is resolved, please reward & close the thread....

Raja T

Message was edited by:

Raja Thangamani