cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB Dropdown - Resolving Model Binding

Former Member
0 Kudos

Hi all,

We are using htmlb dropdowns in several places in our application. The code loooks like this:

<htmlb:dropdownListBox id = "ddLB_customer"

disabled = "<%= lv_disable1 %>"

table = "//my_appl/T_CUSTOMER"

selection = "//my_appl/s_test_st.cust_id"

nameOfKeyColumn = "SEL"

onSelect = "Customer"

nameOfValueColumn = "VALUE" />

The selection is not getting retained in the dropdown though values are populated from the table.

In the above code, when I debug, the CL_HTMLB_DROPDOWNLISTBOX class, the

me->resolve_model_binding( ) method is executed properly and the model class is resolved but finally, the value is not selected on the screen.

But this is the same code that is found in SBSPEXT_HTMLB application.

However, this code works fine but only some times. The combo values are populated always properly,

but the problem is with selection only.Sometimes, it works fine but this is not the case always.

The problem with selection exists here also.

<htmlb:dropdownListBox id = "ddLB_customer"

disabled = "<%= lv_disable1 %>"

table = "<%= my_appl->T_CUSTOMER%>"

selection = "<%= my_appl->s_test_st-cust_id%>"

nameOfKeyColumn = "SEL"

onSelect = "Customer"

nameOfValueColumn = "VALUE" />

In the above case, me->resolve_model_binding( ) method does not actually resolve the model because,

the variables, _selection, _table are empty.

Which of the above is correct code and why are the selection values not retained in the above codes?

Is there something which is missing?

Please help.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

the upper one method is used to for model binding.

the syntax is correct.

you didnt wrote about the table type you used i.e T_CUSTOMER

for dropdown listbox the table should be a table type of name value pair.

so t_customer should be a table type of name value pair.

and just fill t_customer prior to its display by desired values.

regards.

Former Member
0 Kudos

Hi,

Thanks for you reply. I tried the first method. But this code

data ?= cl_htmlb_manager=>get_data

(request = runtime->server->request

name = 'dropdownListBox'

id = 'ddLB_customer').

data->selection is not fetching any value. So, I am unable to capture the selected value in the

do handle event of the controller.

Any idea why this is happening?

Former Member
0 Kudos

Hi,

The customer table is a table of user defined type - structure with 3 fields - chk, sel, value.

The sel and value have been set appropriately as below. nameOfKeyColumn = "SEL"

nameOfValueColumn = "VALUE" in the dropdownlist box code.

I hope there will be no problem with this.

Former Member
0 Kudos

hi,

just create a new table using table type TIHTTPNVP(name value pair table type).

and fill this using your values from your table.

now use this table.

since you are using model binding you need not require to catch event to get selected value.

in model binding the values are directly moved to and fro between model and page.but the server round trip is required. which can be made using attribute onSelect.

regards.