BlockSpec (taack-ui 0.3.8 API)
Package: taack.ui.base.block

[Groovy] Class BlockSpec

    • taack.ui.base.block.BlockSpec


    • @groovy.transform.CompileStatic
      final class BlockSpec
      extends java.lang.Object

      UiBlockSpecifier#ui(groovy.lang.Closure) delegated class.

      This class allows to draw the layout of a page, or to update part of a page after an ajax call.

      Each block can contains many graphical elements, but it is better to have one graphical element (show, form, table, tableFilter ...) per block (modal, ajaxBlock ...)

      • Property Detail

        • java.lang.String currentBlockId

        • final java.lang.String filterTableId

        • java.lang.String id

      • Method Detail

        • void ajaxBlock(java.lang.String id, java.lang.Boolean visitAjax, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          Ajax block must be children of ajaxBlock. Mandatory invisible block that enable ajax.

          Parameters:
          id - uniq id in the page.
          visitAjax - set to false to process block like non ajax block
          closure - description of the user interface

        • void anonymousBlock(BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          invisible blocks that enable complex layout. Can be nested.

          Parameters:
          width
          closure

        • void blockTabs(BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          Embeds tab. The closure should contains only blockTab(java.lang.String, groovy.lang.Closure) children.

          Parameters:
          width - width of the tabulation block
          closure - description of the tabulations

        • static groovy.lang.Closure<BlockSpec> buildBlockSpec(@groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          Helper method allowing to split block creation. See inline(groovy.lang.Closure) to inject this block into another block.

          Parameters:
          closure - closure that should benefit from IDE completion and static type checking
          Returns:
          typed closure

        • void chart(java.lang.String i18n, UiChartSpecifier chartSpecifier, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add a chart to the block

          Parameters:
          i18n - label of the chart
          chartSpecifier - description of the Chart. See UiChartSpecifier
          width - the with of the chart in the block
          closure - actions to add in the header of the chart

        • void closeModal(java.lang.String id, java.lang.String value, FieldInfo[] fields)

          Close the topmost modal. Usually, it passes an ID and a label to a form in a many to many relationship, if you open a modal using FormSpec.ajaxField.

          Parameters:
          id - the ID of the object
          value - the label of the object (should use toString() obejct method)
          fields - allow to update the form from which ajaxField has been called with the values of the fields listed

        • void closeModal(java.lang.Long id, java.lang.String value, FieldInfo[] fields)

          Close the topmost modal. Usually, it passes an ID and a label to a form in a many to many relationship, if you open a modal using FormSpec.ajaxField.

          Parameters:
          id - the ID of the object
          value - the label of the object (should use toString() obejct method)
          fields - allow to update the form from which ajaxField has been called with the values of the fields listed

        • void closeModal(FieldInfo[] fields)

          Close the topmost modal. Usually, it passes an ID and a label to a form in a many to many relationship, if you open a modal using FormSpec.ajaxField.

          Parameters:
          fields - allow to update the form from which ajaxField has been called with the values of the fields listed

        • void closeModalAndUpdateBlock(@groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          Generic close. Close the topmost modal, and update the block of the pages.

          Parameters:
          closure - describe how to update the page. This closure must not target elements that are in the current modal.

        • void custom(java.lang.String i18n, java.lang.String html, taack.ui.base.common.Style style, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add custom HTML code in a block

          Parameters:
          i18n - label of the block part
          html - code
          style - the template style to use
          width - width inside the block
          closure - actions to display in the header

        • void custom(java.lang.String html, taack.ui.base.common.Style style, BlockSpec.Width width)

          Add custom HTML code in a block

          Parameters:
          html - code
          style
          width

        • void form(java.lang.String i18n, UiFormSpecifier formSpecifier, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add a form in a block

          Parameters:
          i18n - label in the header of the form
          formSpecifier - the form description see UiFormSpecifier
          width
          closure - list of action in the header to add. See BlockActionSpec

        • void modal(boolean firstPass, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockSpec) groovy.lang.Closure closure)

          Pop a modal. Nested blocks will be displayed inside this modal.

          Parameters:
          firstPass - (optional) if true create a new modal, if false, replace the content of the top modal.
          closure - content of the modal

        • void show(java.lang.String i18n, UiShowSpecifier showSpecifier, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add a show in a block. See UiShowSpecifier. A show serves to display object data with limited edition capabilities

          Parameters:
          i18n - label in the header of the show
          showSpecifier - the object data to display
          width
          closure - list of action in the header to add. See BlockActionSpec

        • void table(UiTableSpecifier tableSpecifier, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add a table to the block

          Parameters:
          tableSpecifier - the description of the table
          width - the width
          closure - actions to display in the header. Should use table(java.lang.String, taack.ui.base.UiTableSpecifier) if you want to add actions into the header

        • void tableFilter(java.lang.String i18nFilter, UiFilterSpecifier filterSpecifier, java.lang.String i18nTable, UiTableSpecifier tableSpecifier, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)

          Add a filter and its associated table to the block

          Parameters:
          i18nFilter - filter label
          filterSpecifier - description of the filter
          i18nTable - table label
          tableSpecifier - description of the table
          closure - action ot display along with the label in the header

        • void tableFilter(java.lang.String i18nFilter, UiFilterSpecifier filterSpecifier, java.lang.String i18nTable, UiTableSpecifier tableSpecifier, BlockSpec.Width width, @groovy.lang.DelegatesTo(strategy: Closure.DELEGATE_FIRST, value: BlockActionSpec) groovy.lang.Closure closure)