0

I read the example of a celltable here, it use for load data this structure:

 private static final List<Contact> CONTACTS = Arrays.asList(
  new Contact("John", new Date(80, 4, 12), "123 Fourth Avenue"),
  new Contact("Joe", new Date(85, 2, 22), "22 Lance Ln"),
  new Contact("George", new Date(46, 6, 6), "1600 Pennsylvania Avenue"));

if I have a simple list of string how can put my List into this type of structure?

Rikesh
  • 26,156
  • 14
  • 79
  • 87
v3ctor
  • 105
  • 1
  • 2
  • 10
  • Do you want to use `String` instead of `Contact` type? And what's your problem? But are you sure that you need **CellTable** in this case? Table implies displaying of information distributed by columns. If you have simple list in single column, output it as simple list. Don't complicate. – kapandron Jan 08 '13 at 01:16
  • my external aplication send 3 information as array of string how can capture this 3 info and add to this structure? – v3ctor Jan 08 '13 at 08:27
  • Is your array only 3 equivalent strings or info objects with 3 different field as string in each of them? Show code you have please. – kapandron Jan 08 '13 at 08:35
  • i have private static final List CONTACTS; and a list with many string i need to load this string into the celltable – v3ctor Jan 08 '13 at 18:37

1 Answers1

0

If you have a list of Strings then you would be displaying them in a ListBox. If you still intend to use it in a CellTable then wrap the String in a Model/POJO/Bean object.

Example - String "name" is wrapped in "ContactInfo" Bean.

You can then use ContactInfo with CellTable. Cell Widgets all work with MVP design Model -> View -> Presenter

ContactInfo -> Model
CellTable -> View
ListDataProvider -> Presenter
Saeed Zarinfam
  • 9,818
  • 7
  • 59
  • 72
appbootup
  • 9,537
  • 3
  • 33
  • 65