Which component should I use to show a list data?

109 views
Skip to first unread message

Victor Fan

unread,
Mar 26, 2014, 4:16:45 AM3/26/14
to codenameone...@googlegroups.com

Hi,
    I'm working on the Codename One, and I read the developer guide. Now I have a list data to show with a component, but I know that there are three component I can use, MultiButton, List and MultiList. The list data consist with many objects which contain user name, user icon and series of characters message. I studyed Codename One for a week,  so I want to know which component should I use? 
   Thanks a lot.

Sadart Abukari

unread,
Mar 26, 2014, 6:41:48 AM3/26/14
to codenameone...@googlegroups.com
I am sure you have already gone through the How Do I Videos at http://www.codenameone.com/how-do-i.html plus get the demos at http://www.codenameone.com/download.html into NetBeans or any supported IDE so you can use the designer to view the demo layouts. Now to your question. If you have just one image in each list item I will recommend  MultiList. More than one Image, List with a renderer. Too many MultiButton used as a list can cause performance issues  unless you are destroying some as shown in http://gadgets.coolman.ca/lazy-loading-implementing-an-infinite-list-in-codename-one/
Note that a list with a renderer is the most flexible way of getting a list exactly the way you want it so I always use that. Just personal preference.

Shai Almog

unread,
Mar 26, 2014, 2:22:43 PM3/26/14
to codenameone...@googlegroups.com
Hi,
there are more component types. It depends on what you are trying to do, your data source and scale.

Victor Fan

unread,
Mar 26, 2014, 9:30:17 PM3/26/14
to codenameone...@googlegroups.com
Thanks for you respond.
The list data is not complex, it's just use for chat messages layout  which contains one user icon, use name, chat messages which may have  series of characters or some face icon(.gif) or one picture at most, and a perfect backgroud image to display. Just look at the below image. Now which component should I use to display? Thanks again.
PS:( I used to work on android  mobile develop by eclipse, and I published a app)

Victor Fan

unread,
Mar 26, 2014, 9:38:02 PM3/26/14
to codenameone...@googlegroups.com
Thanks for your response. I will l think about it carefully.

Shai Almog

unread,
Mar 27, 2014, 2:24:45 AM3/27/14
to codenameone...@googlegroups.com
For chat messages like this I suggest looking at some of our discussions on the subject just search the forum for chat.

Victor Fan

unread,
Mar 27, 2014, 9:42:37 PM3/27/14
to codenameone...@googlegroups.com
I got it. Thanks.

在 2014年3月27日星期四UTC+8下午2时24分45秒,Shai Almog写道:
Reply all
Reply to author
Forward
0 new messages