@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 ...)
Modifiers | Name | Description |
---|---|---|
static enum |
BlockSpec.Width |
Width ratio of the block into the parent block (should be the page itself most of the time). |
Type | Name and description |
---|---|
BlockActionSpec |
blockActionSpec |
IUiBlockVisitor |
blockVisitor |
java.lang.String |
currentBlockId |
java.lang.String |
filterTableId |
java.lang.String |
id |
Constructor and description |
---|
BlockSpec
(IUiBlockVisitor blockVisitor) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
ajaxBlock(java.lang.String id, java.lang.Boolean visitAjax, groovy.lang.Closure closure) Ajax block must be children of ajaxBlock. |
|
void |
anonymousBlock(BlockSpec.Width width, groovy.lang.Closure closure) invisible blocks that enable complex layout. |
|
void |
blockTab(java.lang.String i18n, groovy.lang.Closure closure) Allow to describe the content of a tab. must be children of blockTabs(taack.ui.base.block.BlockSpec.Width, groovy.lang.Closure) |
|
void |
blockTabs(BlockSpec.Width width, groovy.lang.Closure closure) Embeds tab. |
|
static groovy.lang.Closure<BlockSpec> |
buildBlockSpec(groovy.lang.Closure closure) Helper method allowing to split block creation. |
|
void |
chart(java.lang.String i18n, UiChartSpecifier chartSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) Add a chart to the block |
|
void |
closeModal(java.lang.String id, java.lang.String value, FieldInfo[] fields) Close the topmost modal. |
|
void |
closeModal(java.lang.Long id, java.lang.String value, FieldInfo[] fields) Close the topmost modal. |
|
void |
closeModal(FieldInfo[] fields) Close the topmost modal. |
|
void |
closeModalAndUpdateBlock(groovy.lang.Closure closure) Generic close. |
|
void |
custom(java.lang.String i18n, java.lang.String html, taack.ui.base.common.Style style, BlockSpec.Width width, groovy.lang.Closure closure) Add custom HTML code in a block |
|
void |
custom(java.lang.String html, taack.ui.base.common.Style style, BlockSpec.Width width) Add custom HTML code in a block |
|
void |
form(java.lang.String i18n, UiFormSpecifier formSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) Add a form in a block |
|
void |
inline(groovy.lang.Closure<BlockSpec> blockSpecClosure) Allow to inject a block part that has been created elsewhere. |
|
void |
modal(boolean firstPass, groovy.lang.Closure closure) Pop a modal. |
|
void |
show(java.lang.String i18n, UiShowSpecifier showSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) Add a show in a block. |
|
void |
table(UiTableSpecifier tableSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) Add a table to the block |
|
void |
table(java.lang.String i18n, UiTableSpecifier tableSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) Add a table to the block with a header. |
|
void |
tableFilter(java.lang.String i18nFilter, UiFilterSpecifier filterSpecifier, java.lang.String i18nTable, UiTableSpecifier tableSpecifier, groovy.lang.Closure closure) Add a filter and its associated table to the block |
|
void |
tableFilter(java.lang.String i18nFilter, UiFilterSpecifier filterSpecifier, java.lang.String i18nTable, UiTableSpecifier tableSpecifier, BlockSpec.Width width, groovy.lang.Closure closure) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Ajax block must be children of ajaxBlock. Mandatory invisible block that enable ajax.
id
- uniq id in the page.visitAjax
- set to false to process block like non ajax blockclosure
- description of the user interfaceinvisible blocks that enable complex layout. Can be nested.
Allow to describe the content of a tab. must be children of blockTabs(taack.ui.base.block.BlockSpec.Width, groovy.lang.Closure)
i18n
- labelclosure
- content of the tabulation.Embeds tab. The closure should contains only blockTab(java.lang.String, groovy.lang.Closure) children.
width
- width of the tabulation blockclosure
- description of the tabulationsHelper method allowing to split block creation. See inline(groovy.lang.Closure) to inject this block into another block.
closure
- closure that should benefit from IDE completion and static type checkingAdd a chart to the block
i18n
- label of the chartchartSpecifier
- description of the Chart. See UiChartSpecifierwidth
- the with of the chart in the blockclosure
- actions to add in the header of the chartClose 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.
id
- the ID of the objectvalue
- 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 listedClose 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.
id
- the ID of the objectvalue
- 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 listedClose 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.
fields
- allow to update the form from which ajaxField has been called with the values of the fields listedGeneric close. Close the topmost modal, and update the block of the pages.
closure
- describe how to update the page. This closure must not target elements that are in the current modal.Add custom HTML code in a block
i18n
- label of the block parthtml
- codestyle
- the template style to usewidth
- width inside the blockclosure
- actions to display in the headerAdd custom HTML code in a block
html
- codeAdd a form in a block
i18n
- label in the header of the formformSpecifier
- the form description see UiFormSpecifierclosure
- list of action in the header to add. See BlockActionSpecAllow to inject a block part that has been created elsewhere. See buildBlockSpec(groovy.lang.Closure)
Pop a modal. Nested blocks will be displayed inside this modal.
firstPass
- (optional) if true create a new modal, if false, replace the content of the top modal.closure
- content of the modalAdd a show in a block. See UiShowSpecifier. A show serves to display object data with limited edition capabilities
i18n
- label in the header of the showshowSpecifier
- the object data to displayclosure
- list of action in the header to add. See BlockActionSpecAdd a table to the block
tableSpecifier
- the description of the tablewidth
- the widthclosure
- actions to display in the header. Should use table(java.lang.String, taack.ui.base.UiTableSpecifier) if you want to add actions into the headerAdd a table to the block with a header. If you intent to use the table with a filter, use tableFilter(java.lang.String, taack.ui.base.UiFilterSpecifier, java.lang.String, taack.ui.base.UiTableSpecifier)
i18n
- label in the block headertableSpecifier
- the description of the tablewidth
- the width of the table in the blockclosure
- actions to display in the headerAdd a filter and its associated table to the block
i18nFilter
- filter labelfilterSpecifier
- description of the filteri18nTable
- table labeltableSpecifier
- description of the tableclosure
- action ot display along with the label in the headerGroovy Documentation