MultiList model

22 views
Skip to first unread message

luca...@gmail.com

unread,
Jul 7, 2016, 3:05:10 PM7/7/16
to CodenameOne Discussions
Hi, I'm writing an application that fetches data from a web service.
I have no problem to retrieve the data.
My model (of retrieved data) is similar to the following:
- id
- name
- surname
- address
I want to show it in a multilist, and i know how to do it by passing a map like this:
"Line1" -> id
"Line2" -> name
etc.
The problem is that i want to show only few lines (e.g. name, surname) and, when i click on the object, i want to open another form with the detail (id, name, surname, address).
I have no idea how to do it!

Thank you!!

Shai Almog

unread,
Jul 8, 2016, 1:32:39 AM7/8/16
to CodenameOne Discussions, luca...@gmail.com
Hi,
I would recommend avoiding multi-list and just using MultiButtons in a BoxLayout Y. You can also use InfiniteScrollAdapter to support pagination etc.
You can see a sample of this in the property cross demo: http://www.codenameone.com/blog/property-cross-revisited.html

If you still choose to use a multi-list you can just use an action listener on the list and get the selected item to show a form.

luca...@gmail.com

unread,
Jul 16, 2016, 4:46:43 PM7/16/16
to CodenameOne Discussions, luca...@gmail.com
Thank you very much for your help, i did with MultiButtons!!
Reply all
Reply to author
Forward
0 new messages