Android Question B4XComboBox- Delete Item while opening

Bob Spielen

Active Member
Licensed User
I use SelectedItem=0 of my Spinner list as my Prommt text.
Maybe I don't use .Prommt function correctly, because when I try to use it, it does not appear....
I tried to find an example using prommt, but didn't find.
Can someone give me an example of prommt use in B4XCombobox or is it possible to have an list Item removed while opening the dropdown_list ?
Thanks in advance
 

mangojack

Well-Known Member
Licensed User
.SelectedItem is Read Only ...

Capture.PNG


use .SelectedIndex
B4X:
B4XComboBox1.SelectedIndex = 2

Can someone give me an example of prommt use in B4XCombobox or is it possible to have an list Item removed while opening the dropdown_list ?
The Thread title and the second part of this statement confuse me . You would need to supply more info if the above has not solved your problem.
Also I see no referenece for a .Prommt (Prompt) method. ?
 
Last edited:

Bob Spielen

Active Member
Licensed User
.....The Thread title and the second part of this statement confuse me . You would need to supply more info if the above has not solved your problem.
Also I see no referenece for a .Prommt (Prompt) method. ?
Mj thanks a lot for your reply. My problem is to show a first text in my combobox. Today I insert 2 lines .....

B4X:
Cooplist.InsertAt(0, "Click here for selection")
Cooplist.InsertAt(Cooplist.Size, "Add new Customer")
So I have a first comment in the combobox at the Item(0) and a last Comment at the end.

I tried to use the .promt function
B4X:
B4XComboBox1.cmbBox.Prompt="***************************"
but din't work....

So I wanted to delete Item(0) while droping down the combobox.list...
or
to learn how to use the promt function.....
 
Last edited:

mangojack

Well-Known Member
Licensed User
Ahh .. I know exactly what your trying to achieve now. I was testing in B4J , thats why I did not see the .Prompt method.

I have had the same issue and are in the process of designing my own custom combo box.
In actual fact my first Item was blank " " because I did not want a Prompt text .

This might shed some light on the cmbBox (Spinner) .Prompt issue.

As far as I know , there is no actual event to detect if the combo list has been clicked (expanded) to give you and opportunity to delete you prompt text ..
And you would then have to manually re-add the prompt text again.

Maybe @Erel could shed some thoughts / solution.
 
Top