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
Use the following BIAL syntax to get the values inside the combo.
COMBOBOX_1.getSelectedKey();
COMBOBOX_1.getSelectedValue();
Best
Leandro
Hi Leandro,
Thanks for sharing !! Looks good 🙂
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
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
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.
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