cancel event order
6 posts
• Page 1 of 1
cancel event order
Hi,
I'am using eventBeforeRowSelect to check some conditions before the other row is actually selected. Is there a possibility to stop selecting the row? For example if a condition is false I don't want to switch to a different row - so I would like to stop the event order.
Thanks in advance.
I'am using eventBeforeRowSelect to check some conditions before the other row is actually selected. Is there a possibility to stop selecting the row? For example if a condition is false I don't want to switch to a different row - so I would like to stop the event order.
Thanks in advance.
- JuFi
- Posts: 12
- Joined: Thu Oct 11, 2018 2:20 pm
Re: cancel event order
Simply throw an Exception to show the error dialog or throw a SilentAbortException to hide the dialog.
-
Support@SIB - Posts: 353
- Joined: Mon Sep 28, 2009 1:56 pm
Re: cancel event order
I tried to throw a SilentAbortException, but then I get this behaviour:
If I try to change rows for the first time and my condition is not met, I throw the SilentAbortException.
On second try my condition is met, but I seem to not get any row change events anymore.
If I try to change rows for the first time and my condition is not met, I throw the SilentAbortException.
On second try my condition is met, but I seem to not get any row change events anymore.
- JuFi
- Posts: 12
- Joined: Thu Oct 11, 2018 2:20 pm
Re: cancel event order
Here's the documentation about DataBook events.
-
Support@SIB - Posts: 353
- Joined: Mon Sep 28, 2009 1:56 pm
Re: cancel event order
This is a bug in the Swing Table implementation.
-
Development@SIB - Posts: 325
- Joined: Mon Sep 28, 2009 1:54 pm
Re: cancel event order
The problem only occurs in Swing UI, with Vaadin UI everything works.
In case of Swing, you could use the workaround:
But this workaround doesn't solve the problem if you double click in the table in case of SilentAbortException. The bug is already fixed and will be available in the next JVx release or in the nightly builds!
In case of Swing, you could use the workaround:
if (getApplication().getLauncher().isDesktopEnvironment())
{
UIComponent.invokeLater(new Runnable()
{
@Override
public void run()
{
Object o = table.getUIResource().getResource();
if (o instanceof java.awt.Component)
{
((Component)o).removeNotify();
((Component)o).addNotify();
((ITableControl)table.getUIResource()).notifyRepaint();
}
}
});
}
throw new SilentAbortException();
{
UIComponent.invokeLater(new Runnable()
{
@Override
public void run()
{
Object o = table.getUIResource().getResource();
if (o instanceof java.awt.Component)
{
((Component)o).removeNotify();
((Component)o).addNotify();
((ITableControl)table.getUIResource()).notifyRepaint();
}
}
});
}
throw new SilentAbortException();
But this workaround doesn't solve the problem if you double click in the table in case of SilentAbortException. The bug is already fixed and will be available in the next JVx release or in the nightly builds!
-
Development@SIB - Posts: 325
- Joined: Mon Sep 28, 2009 1:54 pm
6 posts
• Page 1 of 1