Last page update: November 23, 2011
In this section we explain all the TableHandler types. A TableHandler type is a different way to show the view-data window and the data-entry window.
In particular:
- borderTableHandler: show the view-data window and the data-entry window in a single page
- dialogTableHandler: show the data-entry window in a dialog that appears over the view-data window
- paletteTableHandler: show the data-entry window in a palette that appears over the view-data window
- plainTableHandler: show only the view-data window. User can’t modify records
- stackTableHandler: show the data-entry window and the view-data window in two different stack
Some attributes are common to every of these types and we describe those attributes here:
pane: MANDATORY - the ContentPane to which the TableHandler is linked
Note
we suggest you to link a TableHandler to a ContentPane; avoid a BorderContainer, a TabContainer or other layout elements (if you use them, pay attention to use the correct attributes of the layout elements)
nodeId: the TableHandler nodeId. It is not a mandatory attribute: if you don’t need a specific name for the nodeId, then it is handled automatically
Warning
if you have more than a TableHandler in the same page related to the same table you must MANDATORY define a different nodeId for every TableHandler of that page
table: the path of the table linked to your TableHandler. It is MANDATORY unless you use the relation attribute. For more information, check the table, condition and relation attributes example. The syntax is:
table = 'packageName.tableName'th_pkey: TODO
datapath: the path of your data. If you don’t need a specific datapath it is handled automatically
Warning
if you have more than a TableHandler in the same page related to the same table AND they have the same path level, then you must define MANDATORY a different datapath for every TableHandler of that page that comes into conflict
For more information:
- on “datapath” attribute, check the datapath page
- on TableHandler path levels, check the TableHandler: paths page
formResource: allow to change the default Form class. Check the formResource attribute section for more information
viewResource: allow to change the default View class. Check the viewResource attribute section for more information.
formInIframe: TODO
readOnly: boolean. If True, the TableHandler is in read-only mode, so user can visualize records and open the Form class, but he can’t add/delete/modify records. Default value is True or False depending on the widget (check it in their method definition).
default_kwargs: you can add different kwargs:
virtualStore: boolean. If it is set to True, it introduces two features:
- Add the query operator box (if it is not yet visualized)
- Optimize the time to give the result of a user query: if the user query returns a huge set of records as result, the virtualStore load on the client only the set of records that user sees in his window, and load more records when user scrolls through the result list.
relation: an alternative to the table and the condition attributes. For more information, check the table, condition and relation attributes sections
condition: MANDATORY unless you specify the relation attribute. Check the table, condition and relation attributes section for more information.
condition_kwargs: the parameters of the condition. Check the table, condition and relation attributes section for more information.
grid_kwargs: TODO.
hiderMessage: TODO.
pageName: TODO.
pbl_classes: if True, modify the CSS attributes of the top bar of a grid. For more information, check the pbl_classes page
Definition:
- TableHandler.th_borderTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, formResource=None, viewResource=None, formInIframe=False, widget_kwargs=None, reloader=None, default_kwargs=None, loadEvent='onSelected', readOnly=False, viewRegion=None, formRegion=None, vpane_kwargs=None, fpane_kwargs=None, **kwargs)¶
Description:
Based on the Dojo BorderContainer, the borderTableHandler shows the view-data window and the data-entry window in a single page.
![]()
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.borderTableHandler(...) #not th_borderTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. The attributes that belongs only to the borderTableHandler are listed here:
widget_kwargs: TODO
loadEvent: TODO
viewRegion: add?
formRegion: add?
vpane_kwargs: allow to set the attributes of the view-data window
In particular, you have the following options:
- vpane_region: specify the region occupied by the View class. As for the BorderContainer, you may choose between these values: top, left, right, bottom, center. By default, the View class has vpane_region='top'
- vpane_width (OR vpane_height): specify the width (or the height) occupied by the View class (tip: we suggest you to use a percentage, like ‘30%’) By default, the View class has vpane_height='50%'
Example:
vpane_region='left',vpane_width='36%'fpane_kwargs: allow to set the attributes of the data-entry window
In particular, you have the following options:
- fpane_region: specify the region occupied by the Form class. As for the BorderContainer, you may choose between these values: top, left, right, bottom, center. By default, the Form class has fpane_region='bottom'
- fpane_width: specify the width occupied by the Form class (tip: we suggest you to use a percentage, like ‘30%’) By default, the Form class has fpane_height='50%'
Example:
vpane_region='right',vpane_width='70%'
Definition:
- TableHandler.th_dialogTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, formResource=None, viewResource=None, formInIframe=False, dialog_kwargs=None, reloader=None, default_kwargs=None, readOnly=False, **kwargs)¶
Description:
The dialogTableHandler shows the data-entry window in a dialog over the view-data window.
![]()
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.dialogTableHandler(...) #not th_dialogTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. The attributes that belongs only to the dialogTableHandler are listed here:
dialog_kwargs: there are many options:
- dialog_height: MANDATORY - define the dialog height
- dialog_width: MANDATORY - define the dialog width
- dialog_title: define the dialog title
Example:
dialog_height='100px',dialog_width='300px',dialog_title='Customer'
Definition:
- TableHandler.th_pageTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, formResource=None, formUrl=None, viewResource=None, default_kwargs=None, dbname=None, **kwargs)¶
Description:
The pageTableHandler TODO
TODO add image!
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.pageTableHandler(...) #not th_pageTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. The attributes that belongs only to the pageTableHandler are listed here:
- dbname=None: TODO
- formUrl=None: TODO
Example:
TODO
Definition:
- TableHandler.th_paletteTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, formResource=None, viewResource=None, formInIframe=False, palette_kwargs=None, reloader=None, default_kwargs=None, readOnly=False, **kwargs)¶
Description:
The paletteTableHandler shows the data-entry window in a palette over the view-data window.
![]()
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.paletteTableHandler(...) #not th_paletteTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. The attributes that belongs only to the paletteTableHandler are listed here:
palette_kwargs: MANDATORY - define the height and the width of the palette.
Example:
palette_height='100px'; palette_width='300px'
Definition:
- TableHandler.th_plainTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, viewResource=None, readOnly=True, **kwargs)¶
Description:
With the plainTableHandler you have only the view-data window. Also, by default user can’t modify, add and delete records (infact, the readOnly attribute is set to True). Set it to False to change this default behavior.
![]()
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.plainTableHandler(...) #not th_plainTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. There are not attributes belonging only to the plainTableHandler
Definition:
- TableHandler.th_stackTableHandler(self, pane, nodeId=None, table=None, th_pkey=None, datapath=None, formResource=None, viewResource=None, formInIframe=False, widget_kwargs=None, reloader=None, default_kwargs=None, readOnly=False, **kwargs)¶
Description:
Based on the Dojo StackContainer, the stackTableHandler shows the view-data window and the data-entry window in two different pages.
Remembering the Dojo StackContainer definition: <<A container that has multiple children, but shows only one child at a time (like looking at the pages in a book one by one).>>
![]()
Note
you have to call the TableHandler without the th_ string.
Example:
def th_form(self, form): pane = form.center.contentPane() pane.stackTableHandler(...) #not th_stackTableHandler !Attributes:
The attributes that belong to every TableHandler are described in the TableHandler common attributes section. The attributes that belongs only to the stackTableHandler are listed here:
- widget_kwargs: TODO.
Definition:
- TableHandler.th_thFormHandler(self, pane, formId=None, table=None, formResource=None, startKey=None, formCb=None, store_kwargs=None, default_kwargs=None, **kwargs)¶
Description:
TODO
Attributes:
TODO
Some attributes are common to every of these types and we describe those attributes here... TODO
Definition:
- TableHandler.th_thIframe(self, pane, method=None, src=None, **kwargs)¶
Description:
TODO
Attributes:
- pane: TODO.
- method: TODO.
- src: TODO.
Some attributes are common to every of these types and we describe those attributes here:
pane: MANDATORY - the ContentPane to which the TableHandler is linked.
field: a field; through this object the linker becomes related to the table to which the field belongs to.
newRecordOnly: TODO
dialog_kwargs: there are many options:
- dialog_height: MANDATORY - define the dialog height
- dialog_width: MANDATORY - define the dialog width
- dialog_title: define the dialog title
Example:
dialog_height='100px',dialog_width='300px',dialog_title='Customer'
Definition:
- ThLinker.th_linker(self, pane, field=None, formResource=None, formUrl=None, newRecordOnly=None, table=None, openIfEmpty=None, embedded=True, dialog_kwargs=None, default_kwargs=None, **kwargs)¶
Description:
TODO
Attributes:
The attributes that belong to every linker are described in the linker common attributes section. The attributes that belongs only to the th_linker are listed here:
- formResource: allow to change the default Form class. Check the formResource attribute section for more information.
- formUrl: TODO
- table: the database table to which the th_linker refers to
- openIfEmpty: TODO
- embedded: TODO
Definition:
- ThLinker.th_linkerBar(self, pane, field=None, label=None, table=None, _class='pbl_roundedGroupLabel', newRecordOnly=True, **kwargs)¶
Description:
TODO
Attributes:
The attributes that belong to every linker are described in the linker common attributes section. The attributes that belongs only to the th_linkerBar are listed here:
- label: the label of the linkerBar
- table: the database table to which the th_linkerBar refers to
- _class: the CSS style
Definition:
- ThLinker.th_linkerBox(self, pane, field=None, template='default', frameCode=None, formResource=None, newRecordOnly=None, openIfEmpty=None, _class='pbl_roundedGroup', label=None, **kwargs)¶
Description:
TODO
Attributes:
The attributes that belong to every linker are described in the linker common attributes section. The attributes that belongs only to the th_linkerBox are listed here:
template: TODO
frameCode: TODO
formResource: allow to change the default Form class. Check the formResource attribute section for more information.
openIfEmpty: TODO
_class: the CSS style
label: the th_linkerBox label
Example
TODO example explanation
TODO Explain of the tpl folder –> resources/tables/TableName/tpl/default.html
linkerBox('customer_id', dialog_width='300px',dialog_height='260px',dialog_title='Customer', validate_notnull=True,validate_notnull_error='!!Required', newRecordOnly=True,formResource=':MyForm')
The includedGrid is a grid that allows the inline editing. So, the insertion or the modify of records is handled inside the grid
Note
for a complete explanation of the includedGrid, check the includedGrid section