Class SimpleListModule

All Implemented Interfaces:
Component, Editable<SimpleListModule>

public class SimpleListModule extends Module implements Editable<SimpleListModule>
Editable module that renders a list of 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.

  • Constructor Details

    • SimpleListModule

      public SimpleListModule()
  • Method Details

    • create

      public static SimpleListModule create()
    • addItem

      public SimpleListModule addItem(ListItem item)
      Adds to the item model without building or rebuilding rendered structure.
    • removeItem

      public SimpleListModule removeItem(String itemId)
      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

      public ListItem findItem(String itemId)
      Returns the first item with a non-null raw id exactly equal to the query, or null. Null queries never match; no trimming, normalization or descriptor fallback is performed.
    • getItems

      public List<ListItem> getItems()
    • withTitle

      public SimpleListModule withTitle(String title)
      Description copied from class: Module
      Sets optional title consumed by Module.buildContent() implementations.
      Overrides:
      withTitle in class Module
    • withModuleId

      public SimpleListModule withModuleId(String moduleId)
      Description copied from class: Module
      Sets module id and synchronizes the underlying id attribute.
      Overrides:
      withModuleId in class Module
    • buildContent

      protected void buildContent()
      Description copied from class: Module
      Composes module structure.

      Called at most once by Module.build() unless Module.rebuildContent() is invoked. Do not rely on this method for per-request mutation.

      Specified by:
      buildContent in class Module
    • buildEditView

      public Component buildEditView()
      Description copied from interface: Editable
      Builds the main-property edit view for this module.
      Specified by:
      buildEditView in interface Editable<SimpleListModule>
      Returns:
      component containing form controls
    • validate

      public ValidationResult validate(Map<String,String> formData)
      Description copied from interface: Editable
      Validates form data before mutation.
      Specified by:
      validate in interface Editable<SimpleListModule>
      Parameters:
      formData - form field name to value map
      Returns:
      validation result; default is success
    • applyEdits

      public SimpleListModule applyEdits(Map<String,String> formData)
      Description copied from interface: Editable
      Applies 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:
      applyEdits in interface Editable<SimpleListModule>
      Parameters:
      formData - form field name to value map
      Returns:
      this module instance
    • getEditableChildren

      public List<EditableChild> getEditableChildren()
      Description copied from interface: Editable
      Returns editable child handles for nested editing UIs.
      Specified by:
      getEditableChildren in interface Editable<SimpleListModule>
      Returns:
      editable children in UI/display order; default is empty