Class EditablePage
- All Implemented Interfaces:
Component
Lifecycle: row state is mutated via addEditableRow(EditableRow) and markup is
rebuilt on each render call.
Rendering composes temporary markup without changing stored attributes or children. Generic inherited children remain stored but are not emitted. Templates retain this renderer live, including later row and URL configuration. Finish configuration before sharing; row delegates, descendants and request contexts retain their own sharing obligations.
-
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Method Summary
Modifier and TypeMethodDescriptionAppends an editable row to this page.static EditablePageCreates an editable page wrapper for the given page id.Returns the page identifier backing this wrapper.intReturns current editable-row count.render()Renders this component with an empty context.render(RenderContext context) Renders temporary page-builder markup for current rows.withInsertRowUrlTemplate(String template) Sets the insert-control URL template (default/api/pages/{pageId}/rows/insert?position={position}).Methods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, withAttribute, withChild, withClass, withId, withInnerText, withInnerText, withMaxWidth, withMinWidth, withUnsafeHtml, withWidth
-
Method Details
-
create
Creates an editable page wrapper for the given page id. -
withInsertRowUrlTemplate
Sets the insert-control URL template (default/api/pages/{pageId}/rows/insert?position={position}).Only
{pageId}and{position}are supported, as whole path segments or whole query values. Repeated/omitted tokens and fixed URLs are allowed. Literal URL text is preserved. In browser-relevant structure, token-bearing absolute URLs requirescheme://nonempty-literal-authority; protocol-relative, root-relative, relative-path and query-only references are supported. Placement is also checked after browser-style control/space and path-backslash handling, without rewriting the output. Scheme shorthands, empty authorities and opaque templated URLs are unsupported; fixed URLs do not acquire structural validation. This configures only this page's insert controls, not supplied rows.The raw page id is UTF-8 percent-encoded when interpolated during render, not at creation. It must be non-null, nonempty, nonblank, not exactly
.or.., and valid UTF-16. It is not trimmed, normalized or decoded; a literal percent is encoded too. Omitted tokens do not validate their ids. DOM ids are unchanged. Applications own routes, server decoding, authorization and CSRF enforcement.- Parameters:
template- caller-owned URL template- Returns:
- this page
- Throws:
IllegalArgumentException- for null templates, unsupported tokens or token placements
-
addEditableRow
Appends an editable row to this page. -
render
Renders temporary page-builder markup for current rows. Empty pages emit position zero; nonempty pages emit positions one through the row count, after their respective rows. -
render
-
getPageId
Returns the page identifier backing this wrapper. -
getRowCount
public int getRowCount()Returns current editable-row count.
-