Hi All,
there may be a very simple solution to this that I am overlooking after staring at it for too long, so hopefully it's an easy fix. I have an Autocomplete Edittext that is inserted into a layout in the designer, which is supposed to be filled upon the opening of the layout with a list from a text file. When I try to set items from the text file, they don't seem to register. However, if (even though the ACET is inserted into the layout from the designer) I initialize the ACET and add it to the view, it works fine, with exactly the same input data (even though I thought Initializing a designer element was a no-no)... The problem with this is that it creates a second ACET, over the top of the one from the Designer.
The text file is just a list of site names consisting of a code and a location, as a single string, one per line:
0001 (Site1 Location)
0002 (Site2 Location)
0003 (Site3 Location)
The only thing that I can think of is that the Declaration of the ACET in the code is not recognising the ACET from the designer for some reason, although I can't figure out why... all the naming seems consistent between them, unless I'm going blind. I've attached a screenshot of the designer, showing the layout and ACET properties.
Any help with this would be greatly appreciated, I'm hoping it's something incredibly simple that I've overlooked...
Cheers,
Ben
there may be a very simple solution to this that I am overlooking after staring at it for too long, so hopefully it's an easy fix. I have an Autocomplete Edittext that is inserted into a layout in the designer, which is supposed to be filled upon the opening of the layout with a list from a text file. When I try to set items from the text file, they don't seem to register. However, if (even though the ACET is inserted into the layout from the designer) I initialize the ACET and add it to the view, it works fine, with exactly the same input data (even though I thought Initializing a designer element was a no-no)... The problem with this is that it creates a second ACET, over the top of the one from the Designer.
B4X:
Sub Globals
Dim PnlView As Panel
Dim PnlViewSites As Panel
Dim Btn_View_Sites As Button
Dim DDL_ViewSites_Sites As AutoCompleteEditText
Dim Site_List As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
PnlView.Initialize("")
PnlView.LoadLayout("View")
Activity.AddView(PnlView,0,0,100%x,100%y)
PnlView.Visible = False
PnlViewSites.Initialize("")
PnlViewSites.LoadLayout("ViewSites")
Activity.AddView(PnlViewSites,0,0,100%x,100%y)
PnlViewSites.Visible = False
End Sub
Sub Btn_View_Sites_Click
PnlView.Visible = False
PnlViewSites.Visible = True
Site_List = File.ReadList(File.DirInternal,"Site List.txt")
' Msgbox(Site_List,"")
' DDL_ViewSites_Sites.Initialize("")
DDL_ViewSites_Sites.SetItems(File.ReadList(File.DirInternal,"Site List.txt"))
' Activity.AddView(DDL_ViewSites_Sites,50dip,20dip,80%x,30%y)
End Sub
The text file is just a list of site names consisting of a code and a location, as a single string, one per line:
0001 (Site1 Location)
0002 (Site2 Location)
0003 (Site3 Location)
The only thing that I can think of is that the Declaration of the ACET in the code is not recognising the ACET from the designer for some reason, although I can't figure out why... all the naming seems consistent between them, unless I'm going blind. I've attached a screenshot of the designer, showing the layout and ACET properties.
Any help with this would be greatly appreciated, I'm hoping it's something incredibly simple that I've overlooked...
Cheers,
Ben