Buongiorno Ragazzi,
Ho girato tutto il forum b4x, non riesco a trovare una combo che visualizzi immagine e testo, qualcuno ha mai avuto questa esigenza?
Create a pane - with an imageview and a label
add the pane to the combobox
B4X:
Dim p As Pane
p.Initialize("p")
Dim img As Image
Dim iv As ImageView
Dim l As Label
l.Initialize("l")
img.Initialize("directoryToImage","TheImage.jpg")
l.Text = "My Text field"
' image view initialise
iv.Initialize("iv")
' set the image
iv.SetImage(img)
' limit the size of the image
p.AddNode(iv,0,0,20,20)
' add the text
p.AddNode(l,30,0,100,20)
' add to combobox
ComboBox1.Items.Add(p)
sembrava ottima la soluzione,
ma ho 2 problemi,
inizialmente si vede bene cosi
ma appena faccio un pai di volte apri e chiudi il combo,
e selezione una volta un elemento e una volta un altro elemento a caso, appena riapro
mi ritrovo la lista cosi:
come posso risolvere?
altro quesito, come prendo il valore per esempio della label selezionata? per esempio il valore lillo
e come posso fare in modo che mi faccia vedere all'avvio dell'applicazione per esempio il volore della label per esempio Marco, cioe' voglio che si posizioni sul valore di marco ?
You need to get the selected item as a pane, then get the label.text from the label inside the pane.
B4X:
Sub ComboBox1_ValueChanged (Value As Object)
Dim p As Pane = Value
'assuming label is 2nd node in pane
Dim l As Label = p.GetNode(1)
Log(l.Text)
End Sub
As regards the other problem, I've seen that before, but cannot remember the cause or solution. Sorry.
You need to get the selected item as a pane, then get the label.text from the label inside the pane.
B4X:
Sub ComboBox1_ValueChanged (Value As Object)
Dim p As Pane = Value
'assuming label is 2nd node in pane
Dim l As Label = p.GetNode(1)
Log(l.Text)
End Sub
As regards the other problem, I've seen that before, but cannot remember the cause or solution. Sorry.
Hi, There is a problem with the combobox in Javafx, is that it's difficult to customize it with B4J. Basically, if you want to set anything apart from a string, you will encounter problems as I have in this thread...
Here's a demo of how to use the nominatim geocoding API for free. Note: There are other geocoding options if you want to know, leave your comments. Demo file attached Sub GeoCoderNominatim(Query As String) As ResumableSub Dim ResultURL As String Dim j As HttpJob Dim Parameter() As...
Hi, There is a problem with the combobox in Javafx, is that it's difficult to customize it with B4J. Basically, if you want to set anything apart from a string, you will encounter problems as I have in this thread...
Here's a demo of how to use the nominatim geocoding API for free. Note: There are other geocoding options if you want to know, leave your comments. Demo file attached Sub GeoCoderNominatim(Query As String) As ResumableSub Dim ResultURL As String Dim j As HttpJob Dim Parameter() As...
Hi, There is a problem with the combobox in Javafx, is that it's difficult to customize it with B4J. Basically, if you want to set anything apart from a string, you will encounter problems as I have in this thread...
Salve Ragazzi,
stavo provando ad utilizzare questo esempio,
ma purtroppo sembra essere fatto per una vecchia versione di b4j,
qualcuno riesce ad adattarlo per b4j ?
Grazie mille
AnchorPaneParent As AnchorPane ? AncorPane, cose?
e se possibile poterlo " trascinare nel layout"