Closed fdodino closed 8 years ago
Fixed in 3.6.1-SNAPSHOT. Problem was here:
ColumnsLabelProvider
public Transformer<R, Object> getDelegatingTransformer(final int columnIndex) {
return new Transformer<R, Object>() {
@Override
public Object transform(R element) {
return ColumnsLabelProvider.this.decorated.getColumnText(element, columnIndex);
}
};
}
Instead of calling getColumnText, we now use getColumnValue,a new method in ObservableMapProvider.
Original problem also solved (pushing soon new example ejemplosWidget-ui-arena)
Original problem:
The biggest problem here is in table columns. Theres a bindContentsToProperty "or" bindContentsToTransformer
Using the latter will not create any binding. Arena looses information on which property are you using from the object, therefore, it won't refresh the cell when the model changes.
'What steps will reproduce the problem?'
Table cell should actualize its contents, but it does not (unless the whole list changes).
The best approach for this is to have something really similar to transformers in bindings for other controls.
In this way there's still a binding there, so it will be updated automatically upon a change on that property. But it still allows the user to change the way it's been seen.
Also note that in this case the transformer works on the value of the property. While the current transformer works on the object that's one of the item on the list
Note: Arena 3.5.1 has a setTransformer method, but Transformer needs to conform a <String, String> conversion. See example below:
bindContentsToProperty("recibeResumenCuenta").transformer = [ recibe | if (recibe) "SI" else "NO"] does not work,
you should ask
Same situation rises if you define a Transformer class:
is ok while
does not compile.