| Table |
The Table control displays a list of lines split into columns.
The list of columns must be defined statically in the xsl code, but you can use xsl:if or xsl:for-each to display columns based on XPath conditions or XPath loops.
If your list is very big, you can split it into pages, and the control will display a pagination block above and below the table.
The content of the columns can be any combination of xhtml, xsl and acs tags.
The content of the Table can be exported in xls, xlsx and pdf format; you can specify the resulting data type for each column, or exclude columns if need be.
The following sections describe attributes, child elements, and parent elements.
Attribute | Description |
|---|---|
id | unique identifier for this table. |
page | page number for the current page |
lines | XPath expression defining the list of lines in the table |
pagenb | number of pages in the list; if omitted, the pagination block will not be displayed |
nbperpage | number of lines per page |
nbpagesshown | number of links in the pagination block; the pagination links are evenly distributed before and after the current page. For example, if nbpagesshown is 5, and the page displayed is the second one, the links displayed will be 1 2 3 4 5 6 |
total | total number of lines in the list |
offsetnb | if you have several pagination in the same page, you can specify the position of the SQL request in the request list (starting at 0). See StandardExtractor. |
excel | true or false; if true, an excel export button will be placed before or after the table |
excelButtonPosition | left or right; if left, the excel export button will be placed between the top pagination block and the table, and if right, the excel export button will be placed after the table. Default: right |
true or false; if true, a PDF export button will be placed before or after the table | |
printButtonPosition | left or right; if left, the PDF export button will be placed between the top pagination block and the table, after the excel export button, and if right, the PDF export button will be placed after the table. Default: right |
print-template | path for a xsl-fo file to be used as a template to print the Table. The path must be relative to the xsl file. If you use a template, you must use the non standard fo:putthetablehere tag to tell the system where you want the Table to be. |
caption | title for the table |
Element | Description |
|---|---|
Defines complimentary code for the tr tag ouput for each line; only one acs:Line tag is supported. | |
Defines the columns of the table | |
xsl:if / xsl:for-each | These xsl tags can be used to create a dynamic list of acs:Column (see example below) |
Element | Description |
|---|---|
any xhtml or xsl tag |
The XHTML structure created by the acs:Table is the following:
<!-- if @total is defined --> <div class="tbl-results" id="{@id}-results"> [number of lines] / [@total] </div> <!-- if @pagenb is defined and is greater than 1 --> <ul class="tbl-paging"> <!-- if the current page is greater than 1 --> <li class="tbl-paging-previous"> <a href="">previous</a> </li> <!-- for each page to be displayed --> <li class="tbl-paging"> <a href="" [ifcurrent pageclass="shown"[/endif]> [page number] </a> </li> <!-- if the current page is not the last one --> <li class="tbl-paging-next"> <a href="">next</a> </li> </ul> <!-- if @excel true and @excelButtonPosition left --> <span class="button" id="{@id}-excelexport">Excel Export</span> <!-- if @print true and @printButtonPosition left --> <span class="button" id="{@id}-tableprint">PDF Export</span> <table id="{@id}" cellpadding="0" cellspacing="0"> <!-- if @caption is defined --> <caption> [@caption] </caption> <thead> <tr> <!-- for each acs:Column --> <th class="col-[column's position starting at 1]"> <div class="header">@label</div> <!-- the filters --> <div class="icons"> <!-- if @sort-field --> <input type="hidden" id="excelsort-{@id}-{@sort-field}" name="excelsort-{@id}-{@sort-field}" value=""/> <!-- if the column is sorted asc --> <img id="{@id}-sort-{column's position}" src="{@sort-icon-asc or {$root}img/table_sort_asc.gif}" class="button sort-asc"/> <!-- if the column is sorted desc --> <img id="{@id}-sort-{column's position}" src="{@sort-icon-desc or {$root}img/table_sort_desc.gif}" class="button sort-desc"/> <!-- if the column is not sorted --> <img id="{@id}-sort-{column's position}" src="{@sort-icon-none or {$root}img/table_sort_none.gif}" class="button sort-none"/> <!-- if @filter-field --> <!-- if a filter is defined --> <img id="{@id}-filtericon-{column's position}" src="{@filter-icon-on or {$root}img/table_filter_on.gif" class="button filter-on"/> <!-- if no filter is defined --> <img id="{@id}-filtericon-{column's position}" src="{@filter-icon or {$root}img/table_filter.gif" class="button filter"/> <div id="{@id}-filter-{column's position}" class="filter hidden"> <span id="{@id}-filterclose-{column's position}" class="button filterclose"> <img src="{{$root}}img/table_filter_close.gif"/> </span> <div class="innerfilter{@filter-type}"> <!-- if @filter-type='alpha' --> <select name="excelfilter-{@id}-{@filter-field}"> <option value="alphastart"> Start </option> <option value="alphaend"> End </option> <option value="alphaeq"> Equals </option> <option value="alphain"> Part </option> </select> <input type="text" id="excelfiltervalue-{@id}-{@filter-field}" name="excelfiltervalue-{@id}-{@filter-field}" value=""/> <!-- if @filter-type='numeric' --> <select name="excelfilter-{@id}-{@filter-field}"> <option value="numericlt"> < </option> <option value="numericleq"> <= </option> <option value="numericeq"> = </option> <option value="numericgeq"> >= </option> <option value="numericgt"> > </option> </select> <input type="text" id="excelfiltervalue-{@id}-{@filter-field}" name="excelfiltervalue-{@id}-{@filter-field}" value=""/> <!-- if @filter-type='list' --> <input type="hidden" name="excelfilter-{$parent/@id}-{@filter-field}" value="list"/> <ul> <!-- for each @filter-listxpath --> <li> <input id="excelfiltervalue-{@id}-{@filter-field}-{@filter-valuexpath}" type="checkbox" name="excelfiltervalue-{@id}-{@filter-field}" value="{@filter-valuexpath}"/> <label for="excelfiltervalue-{@id}-{@filter-field}-{@filter-valuexpath}"> @filter-labelxpath </label> </li> </ul> <!-- if @filter-type='date' --> <input type="hidden" name="excelfilter-{@id}-{@filter-field}" value="date"/> <span class="button" id="{@id}-dateafter">After</span><br/> <acs:Calendar style="compact" id="excelfiltervalue-{@id}-{@filter-field}-start" init=""/><br/> <span class="button" id="{@id}-datebefore">Before</span><br/> <acs:Calendar style="compact" id="excelfiltervalue-{@id}-{@filter-field}-end" init=""/> </div> <span id="{@id}-filtervalidate-{column's position}" class="button filtervalidate"> <img src="{{$root}}img/table_filter_validate.gif"/> Validate the filter </span> </div> </div> </th> </tr> </thead> <tbody> <!-- for each @lines --> <tr> <!-- call to acs:Line --> <!-- for each column --> <td class="col-{column's position starting at 1}> column's content </td> </tr> <!-- if no lines --> <tr> <td colspan="{numberof columns" class="no-results" xml:lang="en">No result</td> </tr> </tbody> </table> <!-- if @excel true and @excelButtonPosition right --> <span class="button" id="{@idexcelexport">Excel Export</span> <!-- if @print true and @printButtonPosition right --> <span class="button" id="{@id}-tableprint">PDF Export</span>
<acs:Table id="tblLT" excel="true" lines="REQUESTS" page="number(NPAGE[1])" pagenb="number(NBPAGE[1])" nbperpage="20" total="number(RESULTAT[1]/NRESULTAT)"> <acs:Line> <xsl:if test="position() mod 2=1"> <xsl:attribute name="class">colored</xsl:attribute> </xsl:if> </acs:Line> <acs:Column label="Id." sort-field="PROJECT" filter-field="PROJECT" filter-type="numeric"><data:PROJECT/></acs:Column> <xsl:choose> <xsl:when test="/BODY/LOGGE[ENTITEID='135']"> <acs:Column label="Creation date" sort-field="DATE_CREAT"><data:DATE_CREATION/></acs:Column> <acs:Column label="Creator" sort-field="CC.CREATEUR" filter-field="CC.CREATEUR" filter-type="alpha"><data:CREATOR/></acs:Column> </xsl:when> <xsl:otherwise> <acs:Column label="Contract" sort-field="NOMPROJ" filter-field="D.ID" filter-type="list" filter-listxpath="/BODY/PROJECTS" filter-valuexpath="ID" filter-labelxpath="LABEL"><data:PROJECTNAME/></acs:Column> <acs:Column label="Invoicing" sort-field="FACTURATION" filter-field="FD.ID" filter-type="list" filter-listxpath="/BODY/INVOICE" filter-valuexpath="ID" filter-labelxpath="LABEL"><data:INVOICING/></acs:Column> </xsl:otherwise> </xsl:choose> <acs:Column label="Description" filter-field="DM.DESCRIPTION" filter-type="alpha"> <xsl:choose> <xsl:when test="/BODY/PARAMETERS/DASHBOARD-TABLEEXCELEXPORT[.='tblLT']"> <xsl:value-of select="DESCRIPTIONDEMANDE"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="maxLengthSpan"> <xsl:with-param name="value" select="DESCRIPTIONDEMANDE"/> <xsl:with-param name="limit" select="'10'"/> <xsl:with-param name="id" select="concat('span_title_',ID)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </acs:Column> <acs:Column label="Priority" sort-field="PRIORITY" filter-field="P.ID" filter-type="list" filter-listxpath="/BODY/PRIORITY" filter-valuexpath="ID" filter-labelxpath="NOM"><data:PRIORITY/></acs:Column> <acs:Column label="Status" sort-field="STATUTLIB" filter-field="DM.STATUTID" filter-type="list" filter-listxpath="/BODY/STATUSES" filter-valuexpath="ID" filter-labelxpath="LABEL"> <xsl:variable name="statutid"><xsl:value-of select="STATUTID"/></xsl:variable> <xsl:choose> <xsl:when test="($isCustomer or $isCDPCustomer)"> <acs:ListBox id="cST_{ID}" name="cST_{ID}" items="/BODY/STATUSES" valueNode="ID" textNode="INTITULE" init="$statutid" emptyOption="false" enabled="false" /> </xsl:when> <xsl:otherwise> <acs:ListBox id="cST_{ID}" name="cST_{ID}" items="/BODY/STATUSES" valueNode="ID" textNode="INTITULE" init="$statutid" emptyOption="false"/> </xsl:otherwise> </xsl:choose> </acs:Column> <acs:Column label="Developer" sort-field="DEVELOPER" filter-field="S_DEV.ID" filter-type="list" filter-listxpath="/BODY/DEVELOPERS" filter-valuexpath="ID" filter-labelxpath="NAME"> <xsl:variable name="responsibledev"><xsl:value-of select="RESPONSIBLEDEV"/></xsl:variable> <xsl:choose> <xsl:when test="($isCustomer or $isCDPCustomer)"> <acs:ListBox id="cRT_{ID}" name="cRT_{ID}" items="/BODY/DEVELOPER" valueNode="ID" textNode="NOM" init="$responsablerea" emptyOption="false" enabled="false" /> </xsl:when> <xsl:otherwise> <acs:ListBox id="cRT_{ID}" name="cRT_{ID}" items="/BODY/DEVELOPER" valueNode="ID" textNode="NOM" init="$responsablerea" emptyOption="false"/> </xsl:otherwise> </xsl:choose> </acs:Column> <acs:Column label="Comment" sort-field="COMMENT"> <xsl:choose> <xsl:when test="/BODY/PARAMETERS/DASHBOARD-TABLEEXCELEXPORT[.='tblLT']"> <xsl:value-of select="COMMENT"/> </xsl:when> <xsl:otherwise> <xsl:call-template name="maxLengthSpan"> <xsl:with-param name="value" select="COMMENT"/> <xsl:with-param name="limit" select="'10'"/> <xsl:with-param name="id" select="concat('span_title2_',ID)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </acs:Column> <acs:Column label="Charge" sort-field="CHARGE" filter-field="CHARGE" filter-type="numeric" excel-type="decimal" excel-format="{$exportCSVDecimalFormat}"><data:CHARGE/></acs:Column> <acs:Column label="Actions"> <xsl:choose> <xsl:when test="INTERTECHNICIAN=1"> <acs:Button id="updateticket_{ID}" icon="img/edit.gif" text="Update" action="go(1,2507,{ID},'','','');"/>  </xsl:when> <xsl:otherwise> <acs:Button id="updateticket_{ID}" icon="img/edit.gif" text="Update" action="go(1,2502,{ID},'','','');"/>  </xsl:otherwise> </xsl:choose> <xsl:if test="not($isCustomer or $isCDPCustomer)"> <acs:Button id="deleteticket_{ID}" icon="img/delete.gif" text="Delete" action="deleteElement('2501','{ID}')"/> </xsl:if> </acs:Column> </acs:Table>