Class SimpleListModule
- All Implemented Interfaces:
Component, Editable<SimpleListModule>
ListItem components.
Configure items before building. Adding/removing items changes the model and current
editable descriptors, not an already-built child tree. applyEdits(Map) explicitly
rebuilds that tree. Raw item ids and positional editable descriptor ids are separate:
descriptors may use item-N for unassigned ids and renumber without assigning an id.
Configuration is mutable and not thread-safe. Finish configuration before sharing; child delegates and request contexts retain their own sharing requirements.
-
Field Summary
Fields inherited from class HtmlTag
attributes, children, id, innerText, innerTextSlot, selfClosing, tagName, trustedHtml -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds to the item model without building or rebuilding rendered structure.applyEdits(Map<String, String> formData) Applies form data to this module instance.protected voidComposes module structure.Builds the main-property edit view for this module.static SimpleListModulecreate()Returns the first item with a non-null raw id exactly equal to the query, or null.Returns editable child handles for nested editing UIs.getItems()removeItem(String itemId) Removes every item whose non-null raw id equals the literal query.Validates form data before mutation.withModuleId(String moduleId) Sets module id and synchronizes the underlyingidattribute.Sets optional title consumed byModule.buildContent()implementations.Methods inherited from class Module
build, getModuleId, getTitle, invalidateContent, rebuildContent, render, render, withClass, withMaxWidth, withMinWidth, withWidthMethods inherited from class HtmlTag
addClass, addStyle, addTrustedStyle, getChildrenStream, getId, hxDelete, hxGet, hxInclude, hxPatch, hxPost, hxPushUrl, hxPut, hxScrollTargetTop, hxSwap, hxTarget, hxTrigger, withAttribute, withChild, withId, withInnerText, withInnerText, withUnsafeHtml
-
Constructor Details
-
SimpleListModule
public SimpleListModule()
-
-
Method Details
-
create
-
addItem
Adds to the item model without building or rebuilding rendered structure. -
removeItem
Removes every item whose non-null raw id equals the literal query. A null query removes nothing. Unassigned ids and positional editable descriptors are not lookup identities. This changes configuration only, not an already-built child tree. -
findItem
-
getItems
-
withTitle
Description copied from class:ModuleSets optional title consumed byModule.buildContent()implementations. -
withModuleId
Description copied from class:ModuleSets module id and synchronizes the underlyingidattribute.- Overrides:
withModuleIdin classModule
-
buildContent
protected void buildContent()Description copied from class:ModuleComposes module structure.Called at most once by
Module.build()unlessModule.rebuildContent()is invoked. Do not rely on this method for per-request mutation.- Specified by:
buildContentin classModule
-
buildEditView
Description copied from interface:EditableBuilds the main-property edit view for this module.- Specified by:
buildEditViewin interfaceEditable<SimpleListModule>- Returns:
- component containing form controls
-
validate
Description copied from interface:EditableValidates form data before mutation.- Specified by:
validatein interfaceEditable<SimpleListModule>- Parameters:
formData- form field name to value map- Returns:
- validation result; default is success
-
applyEdits
Description copied from interface:EditableApplies form data to this module instance.Side effect: mutates this module. Implementations should rebuild cached/built structure when required by module lifecycle semantics.
- Specified by:
applyEditsin interfaceEditable<SimpleListModule>- Parameters:
formData- form field name to value map- Returns:
- this module instance
-
getEditableChildren
Description copied from interface:EditableReturns editable child handles for nested editing UIs.- Specified by:
getEditableChildrenin interfaceEditable<SimpleListModule>- Returns:
- editable children in UI/display order; default is empty
-