Community
Participate
Working Groups
Currently a List Widget can be accessed using the TableRidget (as a Table with one column and no header). Two issues here: a) Its surprising for a developer that there is IListRidget (can be covered with documentation) b) the methods in tableRidget are two complicated (need to many parameters) for a simple list A list can do much less than a table, so we could have a much simplier API with less parameters and less methods for the List widget
There is now an IListRidget that extends ITableRidget. This should address concern (a). To address concern (b) IListRidget adds two simpler bind methods that do not require multiple columns or column headers: void bindToModel(IObservableList rowObservables, Class<? extends Object> rowClass, String columnPropertyName); void bindToModel(Object listHolder, String listPropertyName, Class<? extends Object> rowClass, String columnPropertyName); Note that IListRidget inherits the other bind methods from ITableRidget, but I don't think there is anything to do about this. Resolved.
Created attachment 142355 [details] added simplified bindToModel-Method Added simplified bindToModel-Method to bind a list of Classes that don't conform to the Javabean standard and therefore don't have a property to use for binding. Example: lass Model { List<String> items; public List<String> getItems() { return items; } } IListRidget listRidget; listRidget.bindToModel( new Model(), "items" ); In this case the toString-Method of String is used to render the items in the list.
Created attachment 142365 [details] simplified bindToModel-Method + TestCase
patch applied thank you Steffen