Android Question [SOLVED] Easier way for multiple entries per panel in CLV

AymanA

Active Member
Licensed User
Hi All,

I have a problem with clv that I solved with a not so good approach, so I am aiming someone can guide me how to prolerly use clv in this scenario.

Basically I have jRDC2 data reflected, this data contains user number for example 7,8,9

as an example user 7 can have amount of 200 for year 2018, 2019, 2020.

SO I am trying to group them together on one panel during adding the clv.add

Also there is scenario where only single year is reflected for example user 10 has amount of 200 for 2020, so he shall be reflected in one panel since he has only for one year.

I have tried to put together an example but it is not 100% accurate since I am not using jRDC2 output on that example that I put together, since user 10 has 2 entries for 2020 ( I tried only to reflect one entry for user 10 but for some reason I can not with the example)

So as you will see in the example, clv.add still add the three panel for the grouped years which is not a perfect solution.

Thank you for your help and apologies if the scenario is not clear, let me know and I can explain better.
 

Attachments

  • clv_test.zip
    11.2 KB · Views: 323

Mahares

Expert
Licensed User
Longtime User
So as you will see in the example, clv.add still add the three panel for the grouped years which is not a perfect solution.
Your project idea is most suitable for Nested Customlistview (CLVNested). Here is the link to the class by Erel, with a complete example to get familiar with it:
https://www.b4x.com/android/forum/threads/clvnested-allows-nesting-clvs.107742/#content
Also, here is a link to a complete example by @mangojack that uses CLVNested and works. It is worth running it to see how it works.
 
Upvote 0

AymanA

Active Member
Licensed User
ok I have used the nested CLV before and I ran the example but this is not what I am after, if you run my example you will find that the three entries goes inside one panel (the first panel for 2018) for all the three years, but it leave 2 other not needed items in the CLV.

The purpose of that so I can have dynamic one card like that show the amount each person has for for each year.

The nested CLV add one item for child clv
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
The purpose of that so I can have dynamic one card like that show the amount each person has for for each year.

I do not know if this solves your query ... but I have attached a small example.


Another way of presenting your data ...
 

Attachments

  • CLVExample test.zip
    10.8 KB · Views: 377
Upvote 0

AymanA

Active Member
Licensed User
This definitely solve my problem! Thank you so much for your help and the example/comments! this is very useful! without the help of great people in this forum (like yourself) I would have been in pain with this! I really appreciate your help!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…