CheckBoxTree - Distinguishing unchecking from deleting

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

CheckBoxTree - Distinguishing unchecking from deleting

Postby mduvall » Thu Oct 28, 2010 3:45 am

With CheckBoxTree, is it possible to distinguish between:
a) A user unchecking a checkbox for an item in the tree
and
b) An item getting deleted from the tree

I'm using this in the context of a todo list, where checking and unchecking items means a change in the "completed" status
of the todo item. I also allow users to filter out items based on completetion status. Which means there are cases when
an item gets temporarily "deleted" from the list, but I don't want to change the "completed" status of the underlying todo item.

I have a TreeSelectionListener setup to listen to changes to checkbox state changes, but it seems like
my listener gets called with the same event for both scenarios above.

What I'm currently doing is, every time my valueChanged() method gets called in my listener, I'm checking the
backing TreeModel to see if the item still exists or not. If it still exists, I'm interpreting this a
the users unchecking the item. If the items does not exist in the TreeModel, I'm interpreting this as
the item being deleted.

Is there a better way for me to do all of this?
mduvall
 
Posts: 1
Joined: Thu Oct 28, 2010 3:32 am

Re: CheckBoxTree - Distinguishing unchecking from deleting

Postby JIDE Support » Thu Oct 28, 2010 11:35 am

Please give FilterableCheckBoxTreeSelectionModel a try.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 60 guests