I'm using a YTable. When I have in the table values and I select the first value in the table, I get an object. In this object I get a property and I set in the bean (model), but when I put the method notifyObservers(), the value in not showed in the view, and the method SelectionChanged(Object object) is recalled again in the controller.
This is a bug? or what happen with this case?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When you call notifyObservers() the whole table will be updated (Collection will be copied from YModel to your table). When a table model is recreated, you lose the selection. Therefore, selectionChanged is called again with null.
But I'm not sure why your change is not updated to the table. YTable actually holds same objects as YModel, so if you update an object property, the change should be reflected to table without calling notifyObservers at all. Check what is actually in your YModel Collection after you have changed the row object. And add "if (object != null)" to your selectionChanged method.
Tomi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi tomi:
I'm using a YTable. When I have in the table values and I select the first value in the table, I get an object. In this object I get a property and I set in the bean (model), but when I put the method notifyObservers(), the value in not showed in the view, and the method SelectionChanged(Object object) is recalled again in the controller.
This is a bug? or what happen with this case?
When you call notifyObservers() the whole table will be updated (Collection will be copied from YModel to your table). When a table model is recreated, you lose the selection. Therefore, selectionChanged is called again with null.
But I'm not sure why your change is not updated to the table. YTable actually holds same objects as YModel, so if you update an object property, the change should be reflected to table without calling notifyObservers at all. Check what is actually in your YModel Collection after you have changed the row object. And add "if (object != null)" to your selectionChanged method.
Tomi