A3DPDFScrollTableData

Fields

A3DInt32

m_iGridNbRows

A3DInt32

m_iGridNbCols

A3DInt32

m_iGridHeightCells

A3DInt32 *

m_piGridWidthCells

A3DInt32

m_iSliderWidth

A3DPDFTextFieldData *

m_pCellFormat

A3DPDFRgbColorData *

m_pHighlightColor

A3DPDFEColumnType *

m_peColumnTypes

Detailed Description

struct A3DPDFScrollTableData

Structure to define a ScrollTable widget.

The frame of the scroll table is defined with a grid using parameters m_iGridNbRows, m_iGridNbCols, m_iGridHeightCells, m_piGridWidthCells.

The table header must be defined outside of this function if the layout requires one.

Rich text can be specified in a scroll table. This allows you to apply styling information to portions of the text, such as bold or italic. To do this, the boolean A3DPDFTextFieldData::m_bAllowRichText must be set to TRUE in m_pCellFormat. If m_pCellFormat specifies rich text formatting, then ALL the texts in the table bound to this scrollbar MUST BE defined as rich texts, that is to say they need to be formatted as in the following example.

<?xml version="1.0"?> 
<body xfa:APIVersion="Acroform:2.7.0.0" xfa:spec="2.1" xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0">
<p style="margin-top:0pt;margin-bottom:0pt;text-align:center;font-family:Arial;font-size:10pt;color:#000000">
My Text
</p>
</body>
Text fields first take the format specified in m_pCellFormat, then attributes might be overloaded with the rich text formatting. For example, “text-align” specified in xml style attribute overrides the alignment specified in A3DPDFTextFieldData.m_eTextAlignment.

A scroll table must be bound to a data table with a map that has the same size of the number of columns: the parameter piMapColumns in A3DPDFScrollTableBindToTable should be equal to m_iGridNbCols.

The content of scroll table columns can be texts, images, or checkboxes. The column types must be set with m_peColumnTypes.

For columns of type kA3DPDFImageContent, the data table must contain an icon id, such as returned by the function A3DPDFDocumentAddImageAsIcon2.

For columns of type kA3DPDFCheckBoxContent, the data is generally not set at initialization, but modified at runtime by the user reading the PDF file. The runtime values can be retrieved by a javascript function defined on the document object:

getScrollTableDataForCheckedRows(scrolltableuuid, idxcolcheckboxinscrolltable)
where
  • scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName

  • idxcolcheckboxinscrolltable is the index of column to be checked in the scrolltable

  • The function returns a table object with an extract from the data table of the checked rows. This table object has members: nbrows, nbcols, and data.

For example, a javascript code could be as follows to get all values for the first column of rows with a checked checkbox:
// (pcSTName: returned by A3DPDFWidgetGetName)
// (idxColCheckBox: index of column with checkboxes in the scroll table)
var tablecheckedrows = this.getScrollTableDataForCheckedRows('"' + pcSTName + '", "' + to_string(idxColCheckBox) + '"');
for (i=0;i<tablecheckedrows.nbrows;i++)
  rowscheckedforcol0.push(tablecheckedrows.data[i][0]);  
Also for a column of type kA3DPDFCheckBoxContent, the function A3DPDFCheckBoxSetForCheckAllColumn can be used to associate a ‘check/uncheck all’ functionnality with an additional CheckBox, created separately. This checkbox is automatically unchecked as soon as the user checks a check box in the associated column. Also, it might be useful for a better user experience to uncheck all data column when the associated process is terminated. For this, a javascript function is defined on the document object:
uncheckAllScrollTableData(scrolltableuuid, idxcolcheckboxinscrolltable)
where
  • scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName

  • idxcolcheckboxinscrolltable is the index of column to be unchecked in the scrolltable

On the same way, a javascript function is defined on the document object to enable/disable the checkboxes. This function is typically called during execution of a customer process to disable the checkboxes.
enableScrollTableCheckBoxes(scrolltableuuid, idxcolcheckboxinscrolltable, enable)
where
  • scrolltableuuid is the scrolltable unique id, it can be retrieved with the API A3DPDFWidgetGetName

  • idxcolcheckboxinscrolltable is the index of column to be enabled/disabled in the scrolltable

  • enable is a boolean, which must be ‘true’ to enable all checkboxes of the specified column, and ‘false’ to disable all checkboxes

Version

10.0

Retval A3D_SUCCESS:

Return:

A3D_SUCCESS in case of success or an error code

Public Members

A3DInt32 m_iGridNbRows

The number of rows in the frame.

A3DInt32 m_iGridNbCols

The number of columns in the frame.

A3DInt32 m_iGridHeightCells

The height of cells in the frame.

A3DInt32 *m_piGridWidthCells

Array of the widths of the cells. The array must be of size m_iGridNbCols.

A3DInt32 m_iSliderWidth

The width of the scroll bar (in points). Important: The scrollbar is positioned on the right of the table, outside of the frame. Specify 0 to not have a scroll bar.

A3DPDFTextFieldData *m_pCellFormat

Optional. Defines the text field format for scroll table cells. If NULL, default format is used (black centered Arial text of font size 10, on white background).

A3DPDFRgbColorData *m_pHighlightColor

Optional. Color to highlight a row. If NULL, default color is used (same color as Acrobat fields highlighting).

A3DPDFEColumnType *m_peColumnTypes

Array of the types of the cells. The array must be of size m_iGridNbCols. If NULL, all cells are of kA3DPDFTextContent type.