Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Binding a 1:n:1-related Bean to a TableRidget - referring BUG 254447 - ITableRidget - formatter for columns

Hi Florian,

> I think it is important, to bind each column showing attributes of
> Address to the same property - the address. And the IColumnFormatter will
> resolve the desired attribute.

The IColumnFormatter could do that, but how do you know if an
attribute of address has changed?

The important point here that the IColumnFormatter is just a formatter
(i.e. it provides a string). It does not control the binding, i.e. how
does the table know that the cell's contents have changed.

example: tableRidget.bindToModel(
  WritebleList<list_of_detail>,
  Detail.class,
  new String[] { "address.street", "address.city" },
  new String[] { "City", "Street");

In your case I would first try to use "nested" bindings like above
("address.street", "-> detail.getAddress().getStreet()). In the above
example, my understanding is that the databinding would refresh
column0 if street OR address changes, and column1 if city OR adfress
changes.

The IColumnFormatter can provide additional formatting for a column.
It gets the row element (i.e. a Detail) and must work from there.

Hope this helps. If not, feel free to share a working snippet.

Elias.

On Thu, Feb 26, 2009 at 11:07 AM, Florian Pirchner
<florian.pirchner@xxxxxxxxx> wrote:
> Hi,
>
> actually i am searching for a way to resolve the following problem and
> thought about using a IColumnFormatter. But I am not sure, if this is the
> best matching solution using riena.
>
> I am binding a bean (Header) to a tableRidget. This bean offers a
> Collection<Details>. A Detail has a 1:1 relation to the AdressBean. And i'd
> like to show the attributes of the AddressBean mixed with attributes of
> Detail as tableColumns. I think this wont work without using a
> IColumnFormatter.
>
> The IColumnFormatter returns the desired attribute value. So i will create a
> IColumnFormatter for each column and register them at the tableRidget.
>
> I think it is important, to bind each column showing attributes of
> Address to the same property - the address. And the IColumnFormatter will
> resolve the desired attribute.
>
>
> What do you think about this approach?
>
> Thanks in advance,
> Flo
>
>
>
>
>
> _______________________________________________
> riena-dev mailing list
> riena-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/riena-dev
>
>



-- 
Elias Volanakis
Technical Lead
Innoopract (EclipseSource)
351 NW 12th Avenue
Portland, Oregon 97209

elias@xxxxxxxxxxxxxxxxx
evolanakis@xxxxxxxxxxxxxx
Tel: +1-503-552-1457
Fax: +1-503-715-4915
Mobile: +1-503-929-5537
---
Innoopract is becoming EclipseSource - www.eclipsesource.com


Back to the top