19.6. Cells

Cells are nested within columns (for iteration) or inside worksheets (for direct placement using the column and row attributes) and are responsible for outputting the value, usually through an EL-expression involving the var attribute of the datatable. See Section 19.14.6, “Cell settings”.
<e:cell>
Attributes
  • column — A number value denoting the column that the cell belongs to. The default is the internal counter. Note that the value is 0-based.
  • row — A number value denoting the row where to place the cell. The default is the internal counter. Note that the value is 0-based.
  • value — A string defining the display value. Usually an EL-expression referencing the var-attribute of the containing datatable.
  • comment — A string value defining a comment attached to the cell.
  • commentHeight — The comment height in pixels.
  • commentWidth — The comment width in pixels.
Child elements
Facets
  • none
 
<e:workbook> 
  <e:worksheet>         
    <e:column value="#{personList}" var="person"> 
      <f:facet name="header"> 
        <e:cell value="Last name"/> 
      </f:facet> 
      <e:cell value="#{person.lastName}"/> 
    </e:column> 
  </e:worksheet> 
</e:workbook>
This defines a column with a header and an iterated output.

19.6.1. Validation

Validations are nested inside cells or formulas. They add constraints to cell data.
<e:numericValidation>
Attributes
  • value — A number value denoting the limit (or lower limit where applicable) of the validation.
  • value2 — A number value denoting the upper limit (where applicable) of the validation.
  • condition — A string value defining the validation condition.
    • equal — requires the cell value to match the one defined in the value-attribute.
    • greater_equal — requires the cell value to be greater than or equal to the value defined in the value-attribute.
    • less_equal — requires the cell value to be less than or equal to the value defined in the value-attribute.
    • less_than — requires the cell value to be less than the value defined in the value-attribute.
    • not_equal — requires the cell value to not match the one defined in the value-attribute.
    • between — requires the cell value to be between the values defined in the value and value2 attributes.
    • not_between — requires the cell value not to be between the values defined in the value- and value2 attributes.
Child elements
  • none
Facets
  • none
 
<e:workbook> 
  <e:worksheet> 
    <e:column value="#{personList}" var="person">   
      <e:cell value="#{person.age"> 
        <e:numericValidation condition="between" value="4" value2="18"/> 
      </e:cell> 
    </e:column> 
  </e:worksheet> 
</e:workbook>
This adds numeric validation to a cell, specifying that the value must be between 4 and 18.
<e:rangeValidation>
Attributes
  • startColumn — A number value denoting the first column to validate against.
  • startRow — A number value denoting the first row to validate against.
  • endColumn — A number value denoting the last column to validate against.
  • endRow — A number value denoting the last row to validate against.
Child elements
  • none
Facets
  • none
 
<e:workbook> 
  <e:worksheet> 
    <e:column value="#{personList}" var="person">   
      <e:cell value="#{person.position"> 
        <e:rangeValidation startColumn="0" startRow="0" endColumn="0" 
           endRow="10"/> 
      </e:cell> 
    </e:column> 
  </e:worksheet> 
</e:workbook>
This adds validation to a cell, specifying that the value must exist within the values specified in range A1:A10.
<e:listValidation>
Attributes
  • none
Child elements
  • Zero or more list validation items.
Facets
  • none
e:listValidation is a just a container for holding multiple e:listValidationItem tags.
<e:listValidationItem>
Attributes
  • value — A value to validate against.
Child elements
  • none
Facets
  • none
 
<e:workbook> 
  <e:worksheet> 
    <e:column value="#{personList}" var="person">   
      <e:cell value="#{person.position"> 
        <e:listValidation> 
          <e:listValidationItem value="manager"/> 
          <e:listValidationItem value="employee"/> 
        </e:listValidation> 
      </e:cell> 
    </e:column> 
  </e:worksheet> 
</e:workbook>
This adds validation to a cell, specifying that the value must be "manager" or "employee".