4.10.2.4. TableHandler: types

4.10.2.4.1. TableHandler types - introduction

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:

4.10.2.4.1.1. TableHandler common attributes

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:

  • 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:

      1. Add the query operator box (if it is not yet visualized)
      2. 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

4.10.2.4.1.2. borderTableHandler

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.

../../../_images/border_th28.png

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%'
    

4.10.2.4.1.3. dialogTableHandler

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.

../../../_images/dialog_th28.png

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'
    

4.10.2.4.1.4. pageTableHandler

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

4.10.2.4.1.5. paletteTableHandler

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.

../../../_images/palette_th28.png

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'
    

4.10.2.4.1.6. plainTableHandler

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.

../../../_images/plain_th28.png

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

4.10.2.4.1.7. stackTableHandler

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).>>

../../../_images/stack_th28.png

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.

4.10.2.4.2. thFormHandler

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

4.10.2.4.3. iframe types

4.10.2.4.3.1. iframe common attributes

Some attributes are common to every of these types and we describe those attributes here... TODO

4.10.2.4.3.2. thIframe

Definition:

TableHandler.th_thIframe(self, pane, method=None, src=None, **kwargs)

Description:

TODO

Attributes:

  • pane: TODO.
  • method: TODO.
  • src: TODO.

4.10.2.4.3.3. IframeDialog

Definition:

ThLinker.th_thIframeDialog(self, pane, **kwargs)

Description:

TODO

Attributes:

TODO

4.10.2.4.3.4. iframedispatcher

Definition:

TableHandler.rpc_th_iframedispatcher(self, root, methodname=None, pkey=None, table=None, **kwargs)

Description:

TODO

Attributes:

  • root: TODO
  • methodname: TODO
  • pkey: TODO
  • table: TODO

4.10.2.4.3.5. IframePalette

Definition:

ThLinker.th_thIframePalette(self, pane, **kwargs)

Description:

TODO

Attributes:

TODO

4.10.2.4.4. linker types

TODO (introduction)

They are:

4.10.2.4.4.1. linker common attributes

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'
    

4.10.2.4.4.2. linker

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

4.10.2.4.4.3. linkerBar

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

4.10.2.4.4.4. linkerBox

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')
    

4.10.2.4.5. includedGrid

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