A astronald Active Member Licensed User Longtime User Sep 9, 2021 #1 Hello every one, I try show Search template dialog with flags and text t show country list selection. if fill list with cs this show this code Code: Copy list.add(cs.Initialize.Image(LoadBitmap(File.DirAssets,cPais.ToLowerCase & ".png"),32dip,24dip,False).Append(" " & Paises.Get(cPais)& " " & Nombre).PopAll) well i try fill list with this code Code: Copy opPaises.CustomListView1.AddTextItem( cs.Initialize.Image(LoadBitmap(File.DirAssets,cPais.ToLowerCase & ".png"),32dip,24dip,False).Append(" " & Paises.Get(cPais)& " " & Nombre).PopAll,cPais) i can see flags but this crash in this line This is crash: Code: Copy CO Error occurred on line: 72 (B4XSearchTemplate) java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at anywheresoftware.b4a.objects.collections.List.Get(List.java:117) at b4a.example3.customlistview._getrawlistitem(customlistview.java:447) at b4a.example3.customlistview._finditemoffset(customlistview.java:376) at b4a.example3.customlistview._jumptoitem(customlistview.java:728) at com.pokerlap.admin.b4xsearchtemplate$ResumableSub_Show.resume(b4xsearchtemplate.java:324) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43) at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1714) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8512) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) Can I modify the CustomlistView1? Thanks for your help.
Hello every one, I try show Search template dialog with flags and text t show country list selection. if fill list with cs this show this code Code: Copy list.add(cs.Initialize.Image(LoadBitmap(File.DirAssets,cPais.ToLowerCase & ".png"),32dip,24dip,False).Append(" " & Paises.Get(cPais)& " " & Nombre).PopAll) well i try fill list with this code Code: Copy opPaises.CustomListView1.AddTextItem( cs.Initialize.Image(LoadBitmap(File.DirAssets,cPais.ToLowerCase & ".png"),32dip,24dip,False).Append(" " & Paises.Get(cPais)& " " & Nombre).PopAll,cPais) i can see flags but this crash in this line This is crash: Code: Copy CO Error occurred on line: 72 (B4XSearchTemplate) java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:437) at anywheresoftware.b4a.objects.collections.List.Get(List.java:117) at b4a.example3.customlistview._getrawlistitem(customlistview.java:447) at b4a.example3.customlistview._finditemoffset(customlistview.java:376) at b4a.example3.customlistview._jumptoitem(customlistview.java:728) at com.pokerlap.admin.b4xsearchtemplate$ResumableSub_Show.resume(b4xsearchtemplate.java:324) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144) at anywheresoftware.b4a.BA.raiseEvent(BA.java:193) at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43) at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1714) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8512) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) Can I modify the CustomlistView1? Thanks for your help.
Solution M M Mahares Sep 9, 2021 astronald said: Can I modify the CustomlistView1? Click to expand... Another good option that allows you to have a search box and display text with images is: B4X CLVTree with examples [B4X] CLVTree - Tree View CLVTree extends xCustomListView and turns it into a tree view: Usage: 1. Add a CustomListView with the designer. 2. Initialize CLVTree and add items: Tree.Initialize(CustomListView1) For i = 1 To 10 Dim item As CLVTreeItem = Tree.AddItem(Tree.Root, $"Item #${i}"$, Null, "")... www.b4x.com Also Peter SImpson suite of examples featuring xCustomListView with lazy loading and with Search capabilities is a great source to learn and apply them to real world situations. They helped me learn more about lazy loading. ✅ Part 2 Examples - Creating long lists using xCustomListView with Lazy Loading - Newer developers Hello All, If you're not experienced with using xCustomListView (xCLV) with Lazy Loading (LL) when it comes to loading long lists of data, then I strongly suggest that you read the following post first >>>? Part 1 Basics > XcustomListView www.b4x.com
astronald said: Can I modify the CustomlistView1? Click to expand... Another good option that allows you to have a search box and display text with images is: B4X CLVTree with examples [B4X] CLVTree - Tree View CLVTree extends xCustomListView and turns it into a tree view: Usage: 1. Add a CustomListView with the designer. 2. Initialize CLVTree and add items: Tree.Initialize(CustomListView1) For i = 1 To 10 Dim item As CLVTreeItem = Tree.AddItem(Tree.Root, $"Item #${i}"$, Null, "")... www.b4x.com Also Peter SImpson suite of examples featuring xCustomListView with lazy loading and with Search capabilities is a great source to learn and apply them to real world situations. They helped me learn more about lazy loading. ✅ Part 2 Examples - Creating long lists using xCustomListView with Lazy Loading - Newer developers Hello All, If you're not experienced with using xCustomListView (xCLV) with Lazy Loading (LL) when it comes to loading long lists of data, then I strongly suggest that you read the following post first >>>? Part 1 Basics > XcustomListView www.b4x.com
M Mahares Expert Licensed User Longtime User Sep 9, 2021 #2 astronald said: i can see flags but this crash in this line Click to expand... B4XSearchTemplate works with a list of strings and does not support CSBuilder. You can achieve what you are looking for using B4XTable or maybe other ways. See this link for an example showing flags and search feature using B4XTable. [B4X] B4XTable - Cross platform, sortable, searchable, customizable table B4XTable is a paged based table. The UI is made of a horizontal xCLV. The data is stored in an in-memory SQLite database. How to use? 1. Add a B4XTable with the designer. 2. Add the columns: B4XTable1.AddColumn("US County", B4XTable1.COLUMN_TYPE_NUMBERS) B4XTable1.AddColumn("Name"... www.b4x.com Upvote 2
astronald said: i can see flags but this crash in this line Click to expand... B4XSearchTemplate works with a list of strings and does not support CSBuilder. You can achieve what you are looking for using B4XTable or maybe other ways. See this link for an example showing flags and search feature using B4XTable. [B4X] B4XTable - Cross platform, sortable, searchable, customizable table B4XTable is a paged based table. The UI is made of a horizontal xCLV. The data is stored in an in-memory SQLite database. How to use? 1. Add a B4XTable with the designer. 2. Add the columns: B4XTable1.AddColumn("US County", B4XTable1.COLUMN_TYPE_NUMBERS) B4XTable1.AddColumn("Name"... www.b4x.com
M Mahares Expert Licensed User Longtime User Sep 9, 2021 #3 astronald said: Can I modify the CustomlistView1? Click to expand... Another good option that allows you to have a search box and display text with images is: B4X CLVTree with examples [B4X] CLVTree - Tree View CLVTree extends xCustomListView and turns it into a tree view: Usage: 1. Add a CustomListView with the designer. 2. Initialize CLVTree and add items: Tree.Initialize(CustomListView1) For i = 1 To 10 Dim item As CLVTreeItem = Tree.AddItem(Tree.Root, $"Item #${i}"$, Null, "")... www.b4x.com Also Peter SImpson suite of examples featuring xCustomListView with lazy loading and with Search capabilities is a great source to learn and apply them to real world situations. They helped me learn more about lazy loading. ✅ Part 2 Examples - Creating long lists using xCustomListView with Lazy Loading - Newer developers Hello All, If you're not experienced with using xCustomListView (xCLV) with Lazy Loading (LL) when it comes to loading long lists of data, then I strongly suggest that you read the following post first >>>? Part 1 Basics > XcustomListView www.b4x.com Upvote 1 Solution
astronald said: Can I modify the CustomlistView1? Click to expand... Another good option that allows you to have a search box and display text with images is: B4X CLVTree with examples [B4X] CLVTree - Tree View CLVTree extends xCustomListView and turns it into a tree view: Usage: 1. Add a CustomListView with the designer. 2. Initialize CLVTree and add items: Tree.Initialize(CustomListView1) For i = 1 To 10 Dim item As CLVTreeItem = Tree.AddItem(Tree.Root, $"Item #${i}"$, Null, "")... www.b4x.com Also Peter SImpson suite of examples featuring xCustomListView with lazy loading and with Search capabilities is a great source to learn and apply them to real world situations. They helped me learn more about lazy loading. ✅ Part 2 Examples - Creating long lists using xCustomListView with Lazy Loading - Newer developers Hello All, If you're not experienced with using xCustomListView (xCLV) with Lazy Loading (LL) when it comes to loading long lists of data, then I strongly suggest that you read the following post first >>>? Part 1 Basics > XcustomListView www.b4x.com
A astronald Active Member Licensed User Longtime User Sep 9, 2021 #4 Thanks very much i try and come back with comments Upvote 0