Is it possible hide a form? [message #1456521] |
Thu, 30 October 2014 12:51 |
|
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 #1456550 is a reply to message #1456546] |
Thu, 30 October 2014 13:27 |
|
Hi Jeremie,
yes, all my form are displayed as view and I use my application both in SWT and RAP.
Form A : view in position North
Form B : view in position South
Form C : view actualy in position Center, but I would fill out the window
|
|
|
|
|
Re: Is it possible hide a form? [message #1460213 is a reply to message #1460116] |
Mon, 03 November 2014 10:12 |
|
Thank you both for your suggestions.
I'm following the suggestion of Claudio, because it seems the easiest and most adaptable solution to my situation.
if I have questions or problems on this path, I will ask you more advice.
|
|
|
Re: Is it possible hide a form? [message #1460233 is a reply to message #1460213] |
Mon, 03 November 2014 10:39 |
|
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.03547 seconds