weblaf icon indicating copy to clipboard operation
weblaf copied to clipboard

what's the best way to just detect changes to any boxes in a WebCheckBoxList

Open mokun opened this issue 3 years ago • 1 comments

How do you write an action listener method to just detect changes in any boxes in a WebCheckBoxList ?

mokun avatar Aug 28 '20 06:08 mokun

Something like this would work right now:

final WebCheckBoxList list = new WebCheckBoxList ();
list.addListDataListener ( new ListDataAdapter ()
{
    @Override
    public void contentsChanged ( final ListDataEvent e )
    {
        final int index = e.getIndex0 ();
        final boolean selected = list.isCheckBoxSelected ( index );
    }
} );

That being said, these events can also be thrown when list data itself changes. It's not the best way to handle it, so i'll keep this issue and will add a separate check state listener in next update.

mgarin avatar Aug 28 '20 10:08 mgarin