Greg,

The problem I had is in the behavior of the table when using the
ListAdapter.
The table doesn't seem to update properly. Example when editing a text
field and hitting enter. Nothing happens.
Clicking out of the table, nothing.
I have since noticed if I hit 'esc' I do get an update.
If instead of using a ListAdapter, I use a pivot ArrayList and copy the
objects into it. Then in turn use the pivot ArrayList
The table edits normally.

I'll modify the demo RowEditor as an example:

demo.wtkx - remove all the hard coded tableData.

RowEditorDemo.java - add the following above the line
'window.open(display);'

java.util.ArrayList<CustomTableRow> utilList =
                new java.util.ArrayList<CustomTableRow>();

        CustomTableRow row1 = new CustomTableRow();
        row1.setDate("2009-03-28");
        row1.setType("Travel");
        row1.setAmount("1286.90");
        row1.setDescription("Ticket #145-XX-71903-09");
        utilList.add(row1);

        CustomTableRow row2 = new CustomTableRow();
        row2.setDate("2009-03-28");
        row2.setType("Meals");
        row2.setAmount("34.12");
        row2.setDescription("Took client out");
        utilList.add(row2);
       
        ListAdapter adapter = new ListAdapter(utilList);

        tableView.setTableData(adapter);

Thanks,

Carl


Greg Brown wrote:
> Hi Carl,
> Using a ListAdapter as the table data should work OK. Can you provide
> a code sample that demonstrates more specifically what you are doing
> in #3 below?
> Thanks,
> Greg
>
>
> On Oct 16, 2009, at 6:09 PM, Carl Marcum wrote:
>
>> Hi all,
>>
>> I'm trying to set up an editable TableView based on table data from a
>> ListAdapter backed by a java.util.ArrayList from a JPA query.
>>
>> I've done away with the JPA query portion and tested different ways to
>> build the TableView to find the problem.
>>
>> The problem is the table doesn't seem to edit correctly or fire
>> RowEdited events when I use a ListAdapter to add table data.
>>
>> For this example I'm creating "Customer" objects containing an int "id"
>> and a String "name" property.
>> If I:
>> 1) build the pivot ArrayList in WTKX = ok.
>> 2) build the pivot ArrayList in Java and add it via
>> tableView.addTableData =  ok.
>> 3) build a java.util.ArrayList (like I would get from a JPA query)
>> and create a Pivot ListAdapter then add that with tableView.addTableData
>> =  problem
>>
>> I can create an java.util.ArarryList, and add them one at a time to the
>> Pivot ArrayList and then use it for the table data = ok
>>
>> Am I misunderstanding the use of  ListAdapter to wrap a Java List or use
>> an Adapter for a TableView?
>>
>> Thanks,
>>
>> Carl Marcum
>
>

Reply via email to