Hi Marcel,

You are right! This behavior of ULCListModel is unlike Swing.
 
The selection should clear only when you are setting a new model, changing
the value of an existing list item should not clear the selection.

I have created an issue: http://www.canoo.com/jira/browse/UBA-7702. We
will fix it in a future release.

For now the solution would be to remember the current selection index and
set it again after changing a model item. 

PS: For guaranteed response time to your dev list requests please consider
buying ULC Premium Support.

Thanks and regards,

Janak

-----------------------------------------
Janak Mulani

email: [email protected]
url: http://www.canoo.com

Beyond AJAX - Java Rich Internet Applications 

http://www.canoo.com/ulc
-----------------------------------------  

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Marcel Schoch
> Sent: Monday, February 23, 2009 3:14 PM
> To: [email protected]
> Subject: [ULC-developer] Modifying list model causes 
> selection reset - why?
> 
> Hi
> 
> I run into some troubles with ULCList / AbstractListModel /  
> ULCListSelectionModel.
> 
> I've implemented my own ListModel, extending AbstractListModel. On  
> list data changes, I'm calling 
> AbstractListModel.fireContentsChanged()  
> to notify listeners about the change. I've noticed that this 
> causes a  
> reset of the current selection of this list, which is annoying me.
> 
> Calling AbstractListModel.fireContentsChanged() causes a  
> ULCListSelectionModel.clearSelection() in ULCList code.
> Is there a reason that for? Why is a data change causing a selection  
> change? This behaviour seems not logical to me.
> 
> Regards,
> Marcel
> _______________________________________________
> ULC-developer mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/ulc-developer
> 
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer

Reply via email to