cancel
Showing results for 
Search instead for 
Did you mean: 

Combobox Problem

Former Member
0 Kudos

Hi,

I am using a 2 Combobox from Phtmlb control on my form. When material number is selected.. the corresponding text is populated in the other combobox. and vice versa. thus displaying the data is working fine.

now i want to use these same combobox for input new material number and desc and save this details to the ztable. but when i put material number and clicks on the other combobox to enter the text.. on selection event is fired and this clears offboth my box..

now how do i differentiate, if the user is selecting from the drop down box or if he is typing the new material number in the combo box..

If any one came across this problem..

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Durairaj

it solved my problem.. Actually i was using name as comboBox.. i had to use it as phtmlb:comboBox.

Thanks for your help.

athavanraja
Active Contributor
0 Kudos

i couldnt find a way to differentiate between selecting the from drop down or typing new entry.

but if your intention is to prevent the typed values getting cleared during the server round trip you can avoid that using selection attribute of the combobox tag.

check this code sample:

page attribute:

selection type string.

layout

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<htmlb:content id     = "content"
               design = "DESIGN2003" >
  <htmlb:page>
      <htmlb:form>
        <%
  data tab_spfli type table of spfli.     select * from spfli into table tab_spfli.
        %>
        <phtmlb:comboBox id                 = "combobox_test"
                         behavior           = "FREETEXT"
                         selection          = "<%= selection %>"
                         nameOfKeyColumn    = "CITYFROM"
                         nameOfValueColumn  = "CITYFROM"
                         nameOfValue2Column = "AIRPFROM"
                         onSelect           = "trigger"
                         table              = "<%= tab_spfli %>" />
       
      </htmlb:form>
  </htmlb:page>
</htmlb:content>

on inputprocessing

* event handler for checking and processing user input and
* for defining navigation
DATA: event TYPE REF TO cl_htmlb_event.
DATA: pcbox TYPE REF TO cl_phtmlb_combobox.
DATA: data      TYPE REF TO if_htmlb_data .

*data = cl_htmlb_manager=>get_event_ex( runtime->server->request ).


pcbox ?= cl_htmlb_manager=>get_data(
                                       request = runtime->server->request
                                       name    = 'phtmlb:comboBox'
                                       id      = 'combobox_test'
                                        ).

if not pcbox is initial .
selection = pcbox->value .
endif .

Regards

Raja