Package com.onec.ui
Class PageBuilder
java.lang.Object
com.onec.ui.PageBuilder
Composes a
Page's content: an optional header, a grid of dashboard
widgets, and freeform PageComponent blocks. Widgets reuse the same
builder as UiLayoutBuilder.widget(...), so the full widget config
(type, entity, calendar/kanban/chart options) is available here.
Rendered order is header → widget grid → components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactions(String heading, Consumer<ActionSpec> configurer) Add a section of action buttons — each runs an обработка-style server handler (or routes the client) when clicked.Add the app-settings editor — the@Constantvalues rendered as toggles/inputs and saved in place.Add the settings editor under an optional section heading.Add the settings editor under an optional section heading, restricted to the named@Constants (by their@Constant(name=...)logical name).Add adiv-customextension block (chart, kanban, ...).Embed the full interactive list of a catalog/document — the same surface as its own route, with the New button, custom action buttons, search/sort and rows that open a detail beside the page.pageAction(String key) The page action with this key, ornullif the page declares none.The page's action-button handlers, in declaration order (resolved by key on post-back).subtitle()Add a freeform text block.title()Add a dashboard widget; returns the widget builder for further config.widgets()
-
Constructor Details
-
PageBuilder
public PageBuilder()
-
-
Method Details
-
title
-
subtitle
-
widget
Add a dashboard widget; returns the widget builder for further config. -
text
Add a freeform text block. -
constants
Add the app-settings editor — the@Constantvalues rendered as toggles/inputs and saved in place. A page (e.g. the Settings page) composes this alongside widgets and lists, so settings are just another page built from the framework's primitives. -
constants
Add the settings editor under an optional section heading. -
constants
Add the settings editor under an optional section heading, restricted to the named@Constants (by their@Constant(name=...)logical name). With no names the whole editor is shown; with names you can drop a single toggle (or a small group) onto any page — a dashboard, or a catalog page authored at that route — not just the Settings page. -
actions
Add a section of action buttons — each runs an обработка-style server handler (or routes the client) when clicked. Reuses the sameActionSpecDSL as entity actions, but the buttons live on the page itself rather than a list toolbar, so triggering backend logic is a first-class page primitive:b.actions("Reports", a -> { a.action("createDrafts").label("Create draft reports").icon("file-plus") .handler(ctx -> { reports.createDrafts(); return ActionResult.refresh("Drafts created"); }); a.action("postPending").label("Post pending drafts").icon("send") .handler(ctx -> { reports.postPending(); return ActionResult.message("Posted"); }); });A button's server handler runs only for an authenticated user; because a page action has no entity to gate on, the handler enforces its own authorization via
ctx.user(). -
custom
Add adiv-customextension block (chart, kanban, ...). -
list
Embed the full interactive list of a catalog/document — the same surface as its own route, with the New button, custom action buttons, search/sort and rows that open a detail beside the page. Lets a page (e.g. Settings) manage reference data inline.entityis the catalog or document class. -
title
-
subtitle
-
widgets
-
components
-
pageActions
The page's action-button handlers, in declaration order (resolved by key on post-back). -
pageAction
The page action with this key, ornullif the page declares none.
-