B4J Question how to add the tag property of a button with CustomListView?

fhersof

Member
Hello, to request a little help, I have 2 lists of countries and codes, the countries are shown well in the buttons used with CustomListView, but the codes I want to assign to the tag property of each button, I am stopped at that point.
Thanks so much for any help.
 

Attachments

  • miniprojectwo.zip
    5 KB · Views: 152

mangojack

Expert
Licensed User
Longtime User
I have not used the Preoptimised CLV and did have trouble populating and keeping the View .Tag property . Came across this statement...
Don't use the Tag property at all. Store everything you need in the Value object.


So have reverted to array of maps to store and set the views data ... (plus arrays makes it neater to iterate through the population process)
I know this can be streamlined / improved as well .

I have made some changes ..
All buttons share the same event
More button properties set in Designer instead of Code

I'm unsure of your final thoughts re storing / getting Countries & Codes ( I presume the code file is aligned with Country file ?)
I don't think the 2 separate files are the way to go ... recipe for disaster !

I Can only suggest that these are eventually stored in a Database (Country & Code together) or at least a CSV file

The example is commented explaining changes , thoughts etc. Hope it helps.
 

Attachments

  • miniproject 2.zip
    5.9 KB · Views: 158
Last edited:
Upvote 0
Top