Is it possible hide a form? [message #1456521] |
Thu, 30 October 2014 08:51  |
Eclipse User |
|
|
|
Hi all,
I would need to hide, but not to close, a form when I open another.
I try to clarify my request: when my application start show two form, form A and form B. Form A have with some fields and one button; form B have a tree field and other fields. These two form are respectly defined as display view North and South.
When I click on one node of the tree field, a new form C is opened but I want hide form A and B.
Is it possible make this operation in Scout?
If yes, how?
Thanks in advance for any help and explanation
|
|
|
|
|
|
|
|
Re: Is it possible hide a form? [message #1460233 is a reply to message #1460213] |
Mon, 03 November 2014 05:39  |
Eclipse User |
|
|
|
Hi all,
I want share the solution that I find for this type of situation.
I have two forms that are showed immediately when my application starts; these two forms are opened respectly in North and South area.
When I open a new form, I want hide these two forms and show the new one in the Center area to occupy all space in the window.
To do that I define an arraylist that contains the form that I hide and the following methods in the new form that I ask to open:
...
private ArrayList<IForm> formIds = new ArrayList<IForm>();
...
public class NewHandler extends AbstractFormHandler {
@Override
public void execLoad() throws ProcessingException {
INewFormService service = SERVICES.getService(INewFormService.class);
NewFormFormData formData = new NewFormFormData();
exportFormData(formData);
formData = service.prepareCreate(formData);
importFormData(formData);
//Check the list of Form opened in position North and South to hide
IForm[] viewStack = getDesktop().getViewStack();
for (IForm f : viewStack) {
if (IForm.VIEW_ID_N.equals(f.getDisplayViewId()) || IForm.VIEW_ID_S.equals(f.getDisplayViewId())) {
formIds.add(f);
getDesktop().removeForm(f);
}
}
}
...
@Override
protected void execDisposeForm() throws ProcessingException {
//Check the list of Form opened but hide to show again
if (!formIds.isEmpty()) {
for (IForm f : formIds) {
getDesktop().addForm(f);
}
}
}
I hope this can help someone else who has the same need
|
|
|
Powered by
FUDForum. Page generated in 0.04020 seconds