MessageBox shows with quite a delay [message #1384202] |
Wed, 28 May 2014 07:46  |
Eclipse User |
|
|
|
Hi folks
I discovered an issue with a slow loading MessageBox. It takes about 3s to show the dialog.
The questionable part about the whole thing is, that the same MessageBox will show "normally" fast when opened through a slightly different way.
Description of the issue:
The ominous MessageBox is called within an execValidateValue method inside a Field of a Form.
The value can be changed by user input or programmatically while opening the Form from a TablePage.
If the value of the Field is changed through user input, the MessageBox will show with quite a delay.
Though when the value of the Field is changed programmatically when opening the Form, the MessageBox will show without any delay.
I wrote some sample code, so it might be easier to track the issue down. The order of the events is almost equal to the production code, though very simplified but with the same ominous results.
The Form:
public class TestForm extends AbstractForm {
private Integer data;
public TestForm() throws ProcessingException {
super();
}
public void startModify() throws ProcessingException {
startInternal(new ModifyHandler());
}
public MainBox getMainBox() {
return getFieldByClass(MainBox.class);
}
public NummerField getNummerField() {
return getFieldByClass(NummerField.class);
}
@Order(10.0)
public class MainBox extends AbstractGroupBox {
@Order(10.0)
public class NummerField extends AbstractIntegerField {
@Override
protected Integer execValidateValue(Integer rawValue) throws ProcessingException {
MessageBox.showYesNoCancelMessage("theres", "nothingto", "seehere");
return rawValue;
}
}
@Order(20.0)
public class CancelButton extends AbstractCancelButton {
}
}
public class ModifyHandler extends AbstractFormHandler {
@Override
protected void execLoad() throws ProcessingException {
importData();
}
}
public void setData(Integer data) {
this.data = data;
}
private void importData() {
getNummerField().setValue(data);
}
}
The calling method from the TablePage:
@Order(20.0)
public class BearbeitenMenu extends AbstractMenu {
...
@Override
protected void execAction() throws ProcessingException {
TestForm form = new TestForm();
form.setData(2);
form.startModify();
form.waitFor();
}
}
Thanks in advance for any help.
Best wishes,
Pascal
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08162 seconds