Class ReportSpreadsheetView
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.reportsspreadsheetflowui.view.ReportSpreadsheetView
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,com.vaadin.flow.router.AfterNavigationObserver,com.vaadin.flow.router.BeforeEnterObserver,com.vaadin.flow.router.BeforeLeaveObserver,com.vaadin.flow.router.HasDynamicTitle,com.vaadin.flow.router.internal.AfterNavigationHandler,com.vaadin.flow.router.internal.BeforeEnterHandler,com.vaadin.flow.router.internal.BeforeLeaveHandler,FacetOwner,FragmentOwner,Serializable
@Route(value="report/spreadsheets",
layout=DefaultMainViewParent.class)
@ViewController("report_ReportSpreadsheetView")
@ViewDescriptor("report-spreadsheet-view.xml")
@DialogMode(width="80em",
height="65em",
resizable=true)
public class ReportSpreadsheetView
extends StandardView
View that renders a generated spreadsheet report and allows downloading the current workbook state.
Can be opened either as a dialog or via navigation to its route.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.flowui.view.View
View.AfterCloseEvent, View.BeforeCloseEvent, View.BeforeShowEvent, View.InitEvent, View.PostReadyEvent, View.QueryParametersChangeEvent, View.ReadyEvent, View.RestoreComponentsStateEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected byte[]protected Stringprotected FileRefprotected FileStorageLocatorprotected MessageBundleprotected Notificationsprotected OpenedDialogWindowsprotected JmixButtonprotected ReportDownloaderprotected com.vaadin.flow.component.spreadsheet.Spreadsheetprotected ViewNavigators -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildDownloadFileName(String extension) protected voidcloseOtherDialogs(@Nullable com.vaadin.flow.component.UI ui) Closes any other dialog views that remained open (e.g.protected byte[]Returns the current content of theSpreadsheetcomponent, including unsaved user edits, to be handed over to another instance of this view.voidReads the configured spreadsheet content into theSpreadsheetcomponent.protected voidonCloseBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) protected voidonDownloadBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) protected voidonOpenInViewBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) protected voidonReady(View.ReadyEvent event) protected InputStreamprotected StringvoidsetDocumentContent(byte[] documentContent) Sets generated report content to be opened by this view.voidsetDocumentName(@Nullable String documentName) Sets the report document name shown by the view and used for download.voidsetFileRef(FileRef fileRef) Sets a stored report document reference to be opened by this view.Methods inherited from class io.jmix.flowui.view.View
addAfterCloseListener, addApplicationListeners, addBeforeCloseListener, addBeforeShowListener, addInitListener, addQueryParametersChangeListener, addReadyListener, addRestoreComponentsStateEventListener, afterNavigation, beforeEnter, beforeLeave, close, close, closeWithDefaultAction, configureDialogWindowFooter, configureDialogWindowHeader, getApplicationContext, getEventBus, getId, getReturnParameters, getViewActions, getViewAttributes, getViewData, getViewFacets, getViewSupport, isPreventBrowserTabClosing, onAttach, onAttachInternal, onDetach, onDetachInternal, processBeforeEnterInternal, removeApplicationListeners, removeViewAttributes, setAfterNavigationHandler, setApplicationContext, setId, setPageTitle, setPreventBrowserTabClosing, setViewActions, setViewData, setViewFacets, unregisterBackNavigationMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
spreadsheet
-
messageBundle
-
openInViewBtn
-
fileStorageLocator
-
notifications
-
reportDownloader
-
openedDialogWindows
-
documentContent
protected byte[] documentContent -
fileRef
-
documentName
-
contentLoaded
protected boolean contentLoaded
-
-
Constructor Details
-
ReportSpreadsheetView
public ReportSpreadsheetView()
-
-
Method Details
-
setDocumentContent
public void setDocumentContent(byte[] documentContent) Sets generated report content to be opened by this view. -
setDocumentName
Sets the report document name shown by the view and used for download. -
setFileRef
Sets a stored report document reference to be opened by this view. -
getPageTitle
- Specified by:
getPageTitlein interfacecom.vaadin.flow.router.HasDynamicTitle- Overrides:
getPageTitlein classView<ViewLayout>
-
onReady
-
loadContent
public void loadContent()Reads the configured spreadsheet content into theSpreadsheetcomponent. Idempotent: subsequent invocations (e.g. on a repeated lifecycle event) are no-ops, and the method does nothing untilsetDocumentContent(byte[])orsetFileRef(FileRef)has been called. For the NAVIGATION open mode, where data is set after the regular lifecycle events, this method must be invoked explicitly fromwithAfterNavigationHandler. -
onOpenInViewBtnClick
@Subscribe("openInViewBtn") protected void onOpenInViewBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) -
getCurrentContent
protected byte[] getCurrentContent()Returns the current content of theSpreadsheetcomponent, including unsaved user edits, to be handed over to another instance of this view. Returnsnullif no content has been loaded yet or the current workbook cannot be written, so the caller falls back to the originally provided content. -
closeOtherDialogs
protected void closeOtherDialogs(@Nullable com.vaadin.flow.component.UI ui) Closes any other dialog views that remained open (e.g. the input parameters dialog stacked behind this view), so that the navigation target is shown without leftover modal layers. -
onDownloadBtnClick
@Subscribe("downloadBtn") protected void onDownloadBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) -
onCloseBtnClick
@Subscribe("closeBtn") protected void onCloseBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event) -
openInputStream
- Throws:
IOException
-
resolveWorkbookExtension
-
buildDownloadFileName
-