Skip to Content
Author's profile photo Leandro Cardoso

ComboBox with custom items

Hi there,

This component will allow you to create a combobox with any item you desire.

All you need to do is set the Items property with the following string pattern

KEY,TEXT;KEY2,TEXT2;KEY3,TEXT3

And the component will do the rest.

Here is the code.

olafecorcam/com.leandro.gp.combobox · GitHub

/wp-content/uploads/2014/03/combo_405666.jpg

Use the following BIAL syntax to get the values inside the combo.


COMBOBOX_1.getSelectedKey();
COMBOBOX_1.getSelectedValue();

Best

Leandro

Assigned tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Leandro,

      Thanks for sharing !! Looks good 🙂

      Author's profile photo Former Member
      Former Member

      Hi Leandro,

      I am not sure i understood the difference between the original component and the customized component. We could set items manually at the original component too. Is there something i am missing, could you please explain?


      Thank you,

      Onur

      Author's profile photo Leandro Cardoso
      Leandro Cardoso
      Blog Post Author

      Hi Onur,

      I did not know you could add items manually to a dropdownbox, all I saw on the documentation was using the getitems from a data source, could you share a BIAL example code?

      If it does the same as a standart component, I hope someone can use this as a SAPUI5 example.

      Best

      Leandro

      Author's profile photo Mike Howles
      Mike Howles

      Leandro, you are correct.

      There's no way with the delivered dropdown or listbox or other selection components to manually set items in BIAL without relying on a ValueTextList type parameter, typically from like a GetMemberList function, etc.

      So the value of this SDK component is that you can programatically set the key/texts and pass as a poor man's array (since SDK properties do not accept 'real' arrays yet).  Nice stuff.

      Author's profile photo Former Member
      Former Member

      Hi,

      Michael thanks for the input, now i got the point, i see that i totally misunderstood the concept. And Leandro thanks for sharing your efforts and making our life easier, sorry to ask that if your component was the same as the original one at the first place 🙂

      Best Regards,

      Onur