cancel
Showing results for 
Search instead for 
Did you mean: 

phtmlb comboBox as freetext

Former Member
0 Kudos
49

Hi,

I've got a problem when I am using the comboBox as FREETEXT.


<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%@extension name="phtmlb" prefix="phtmlb" %>
<%
  data: it_tab type table of scarr,
  dummy type string.
  select * from scarr into table it_tab.
%>
<htmlb:content design="design2003" >
  <htmlb:page title="test" >
    <htmlb:form id="f_test" >
      <phtmlb:comboBox id                 = "comboBox"
                       behavior           = "FREETEXT"
                       table              = "<%= it_tab %>"
                       nameOfKeyColumn    = "CARRID"
                       nameOfValueColumn  = "CARRNAME"
                       nameOfValue2Column = "URL" />
      <htmlb:button id      = "button"
                    onKlick = "doSomething"
                    text    = "text" />
      <htmlb:inputField id    = "inputField"
                        value = "<%= dummy %>" />
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

When I write something into the comboBox and press then directly the button I wont get the value in the do_handle_data of my controller. But if I click the inputfield after writing in the combobox and press the button afterwards the value is transfered.

I'm using the IE6 sp2, but if I test the same situation with the Firefox2 there is no problem and it already worked fine with the IE...

Has anybody an idea why the values are not transfered ?

The onKlick event is originally written with an C but than I could not post the thread.

regards,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

Try to add selection attribute as follows:

<phtmlb:comboBox id                 = "comboBox"
                       behavior           = "FREETEXT"
                        selection        = "<%=  some_variable %>"
                       table              = "<%= it_tab %>"
                       nameOfKeyColumn    = "CARRID"
                       nameOfValueColumn  = "CARRNAME"
                       nameOfValue2Column = "URL" />

<b>*Reward each useful answer</b>

Raja T

Former Member
0 Kudos

Hi Raja,

unfortunately the selection attribute doesn't help. So I tried with onSelekt and onClientSelekt.

If I'm using onSelekt the button event comes first-> no chance to get the data...

If I'm using onClientSelekt the client side event comes first, but it would be a dirty hack to pass this value to the controller and not a solution for all phtmlb:comboBoxes..

regards,

Stefan

raja_thangamani
Active Contributor
0 Kudos

May i know why the selection attribute doesnt help you?

Raja T

Former Member
0 Kudos

translations with different meanings are bad...

I meant that it doesn't solve the problem, the freetext value is still not transferred.

And the value of the comboBox is optional so the users could type in nothing and nothing has to be selected. So I can't check if the selection and the value are empty at the same time.

Stefan

athavanraja
Active Contributor
0 Kudos

Hi Stefan,

one alternative option to check the rendred html to see how the <phtmlb:comboBox is rendred and see whether the input field has been rendered with an id, that way we can retrive it using javascript or using get_form_fields

Former Member
0 Kudos

Hi,

sorry for the late answer, but I could not really post the generated code. Also If I replace all onClick with onClikk I can't post or preview the code..

regards,

Stefan

athavanraja
Active Contributor
0 Kudos

you dont have to post the generated code here. just check it yourself

Former Member
0 Kudos

Hi,

I solved the problem. If I read the value of the DDLB with JavaScript when I trigger the onClientClick event of the htmlb button it works.

Thanks for that JS hint, but I still have no idea why that problem occured.

regards,

Stefan

Answers (1)

Answers (1)

Former Member
0 Kudos

I forgot to say that we updated 620 SP61 to SP62 but couldn't find some hints for this situation.