Android Question [Solved] Which View is the most convenient to select an Item from many?

Sergio Castellari

Active Member
Licensed User
Situation:
I need to choose an item from a large list of options (coming from a MySql table)

a) Currently I use "ComboBox" with all the elements pre-loaded to select an Item. When they are few, it is the right view.
b) What view would be correct for cases where you want to select an Item from hundreds available?

Note: Looking at the B4XTable search I would like something similar with data taken from a MySQL table
 

Mariano Ismael Castro

Active Member
Licensed User
Situación:
Necesito elegir un elemento de una gran lista de opciones (proveniente de una tabla MySql)

a) Actualmente utilizo "ComboBox" con todos los elementos precargados para seleccionar un elemento. Cuando son pocos, es la vista correcta.
b) ¿Qué vista sería la correcta para los casos en los que desee seleccionar un artículo entre los cientos disponibles?

Nota: mirando la búsqueda de B4XTable, me gustaría algo similar con datos tomados de una tabla MySQL
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Any example?
What about Trie based search:
It has a full example.
If you stick with B4XSearch, there is an example here:
If you get stuck with your project when you try one or the other, post your project and you will get help.

 
Upvote 2

Sergio Castellari

Active Member
Licensed User
What about Trie based search:
It has a full example.
If you stick with B4XSearch, there is an example here:
If you get stuck with your project when you try one or the other, post your project and you will get help.

@Mahares
Thank you!!!!
I followed the SearchTemplate example and got it to work.
A small example of @Mariano Ismael Castro

Thanks to both of you!

Now I have new needs:
a) Can the list of search items be adjusted to the Left? Currently they are focused and I did not find any property for it.
b) Can the font size be adjusted? I wish a smaller font.

Big hug!!!
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Now I have new needs:
a) Can the list of search items be adjusted to the Left? Currently they are focused and I did not find any property for it.
b) Can the font size be adjusted? I wish a smaller font.
B4X:
Dim lbl As B4XView= SearchTemplate.CustomListView1.DesignerLabel
    Dim f As B4XFont= XUI.CreateFont(Typeface.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 24)  'change the size as you wish smaller or bigger
    lbl.Font =f
    lbl.SetTextAlignment("CENTER", "LEFT")
No hugs Sergio. Covid is tarnishing the entire world of us
 
Upvote 0

Sergio Castellari

Active Member
Licensed User
B4X:
Dim lbl As B4XView= SearchTemplate.CustomListView1.DesignerLabel
    Dim f As B4XFont= XUI.CreateFont(Typeface.CreateNew(Typeface.SERIF, Typeface.STYLE_BOLD), 24)  'change the size as you wish smaller or bigger
    lbl.Font =f
    lbl.SetTextAlignment("CENTER", "LEFT")
No hugs Sergio. Covid is tarnishing the entire world of us
@Mahares
you are a genious!!!!
It worked PERFECT! ... goal accomplished!
I was unaware of these configuration possibilities ... (and I am still unaware ...)
A million thanks!
A big VIRTUAL hug
Have a nice weekend!
 
Upvote 0

Sergio Castellari

Active Member
Licensed User
Maybe it's an abuse (but it's related to my original post):
Is there a way to create a public "SearchTemplate", that is to say that you create it for example in the "Main" or "B4XMainPage" and can invoke it from any B4Xpage?

Greetings
 
Upvote 0
Top