Open PageWithTable several times [message #1853016] |
Tue, 14 June 2022 18:05 |
Nils Israel Messages: 72 Registered: May 2010 |
Member |
|
|
Hi,
in our application we are working with several PageWithTables to find an navigate within our data. If you for example want so search for 2 groups of data to compare something you can't do that within one table page.
I was trying to open a PageWithTable a second time but I think this is not possible due to the concept of Outline/Pages, correct?
But I found an older thread referring to the AbstractPageField and tried it. It might confuse the user because then you have 1 table page without a "Tab" and several table pages with a "Tab" but apart from that it works well.
Is it a good idea to use it like I did? Is there another way to do it?
We are opening other forms e.g. to edit the data from the tablePages (the main one and the pageForm ones).
Or would it be better not to use the PageWithTable for this use case at all and reimplement the Table/SearchForm/DetailForm-logic in an ordinary form and open it multiple times?
PageForm
@FormData(value = PageFormData.class, sdkCommand = FormData.SdkCommand.CREATE)
public class PageForm<T extends AbstractPageWithTable> extends AbstractForm {
private Class<T> pageWithTableClass;
public PageForm(Class<T> pageWithTableClass, String title){
this.pageWithTableClass = pageWithTableClass;
this.setTitle(title);
}
@Order(10.0)
public class MainBox extends AbstractGroupBox {
@Order(10.0)
public class OuterBox extends AbstractPageField<T> {
@Override
protected boolean getConfiguredLabelVisible() {
return false;
}
@Override
protected void execInitField() {
try {
setPage(pageWithTableClass.getDeclaredConstructor().newInstance());
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
throw new ProcessingException("Can't open page.", e);
}
}
}
@Order(30.0)
public class CloseButton extends AbstractCloseButton {
}
}
public void startPageForm() {
startInternal(new PageFormHandler());
}
public class PageFormHandler extends AbstractFormHandler {
}
}
Button to open another "form"-instance of the tablepage itself:
@Order(1000)
public class OpenInADialogMenu extends AbstractMenu {
@Override
protected String getConfiguredText() {
return TEXTS.get("common.open_additional_table_view.label");
}
@Override
protected void execAction() {
var form = new PageForm(MyTablePage.class, getConfiguredTitle());
form.setDisplayHint(IForm.DISPLAY_HINT_VIEW);
form.setAskIfNeedSave(false);
form.startPageForm();
form.waitFor();
}
}
Any comments or input would be much appreciated.
Thanks
Nils
[Updated on: Tue, 14 June 2022 18:09] Report message to a moderator
|
|
|
Re: Open PageWithTable several times [message #1856397 is a reply to message #1853016] |
Thu, 08 December 2022 12:47 |
|
Quote: I was trying to open a PageWithTable a second time but I think this is not possible due to the concept of Outline/Pages, correct?
Yes, this is not part of the concept.
I see the following possibilities:
- Open all pages as views with a page field. However, this would be less comfortable to use and you loose the ability to drill-down.
- Dynamically add new instances of the table page to the outline tree, e.g. using a menu. Depending on the exact use case, this is probably the best option.
- Let the users open multiple instances of the application in multiple browser tabs. (Only works for few tabs, because of the browser's per-host connection limit.)
Regards,
Beat
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds