Comments: on this page. Click to read or post your own.

/sapphire/forms/ComplexTableField.php

Description

Provides a tabuar list in your form with view, edit and add links to edit records with a "has-one"-relationship. Detail-views are shown in a greybox-iframe.

Features pagination in the overview as well as the detail-views.

CAUTION: You need to make sure that the original form-call to the main controller (e.g. EditForm()) returns a form which includes this field even if no data is loaded, to provide a "starting point" for action_callfieldmethod and ReferencedField.

All URL data sent to and from ComplexTableField is encapsulated in $_REQUEST['ctf'] to avoid side-effects with the main controller.

Example-URL for a "DetailForm"-call explained: "/admin/family/?executeForm=EditForm&action_callfieldmethod&fieldName=Individual&childID=7&methodName=edit"

  • executeForm Name of the form on the main rendering page (e.g. "FamilyAdmin")
  • action_callfieldmethod Trigger to call a method of a single field in "EditForm" instead of rendering the whole thing
  • fieldName Name of the targeted formField
  • methodName Method on the formfield (e.g. "ComplexTableField")
  • childID Identifier of the database-record (the targeted table is determined by the $sourceClass parameter)

  • todo: Find a less fragile solution for accessing this field through the main controller and ReferencedField, e.g. build a seperate CTF-instance (doesn't necessarly have to be connected to the original by ReferencedField)
  • todo: Control width/height of popup by constructor (hardcoded at the moment)
  • todo: Integrate search from MemberTableField.php
  • todo: Less performance-hungry implementation of detail-view paging (don't return all items on a single view)
  • todo: Use automatic has-many and many-many functions to return a ComponentSet rather than building the join manually
Classes
Class Description
ComplexTableField Provides a tabuar list in your form with view, edit and add links to edit records with a "has-one"-relationship. Detail-views are shown in a greybox-iframe.
ComplexTableField_ItemRequest
ComplexTableField_Item Single row of a ComplexTableField.
ComplexTableField_Popup ComplexTablefield_popup is rendered with a lightbox and can load a more detailed view of the source class your presenting.
blog comments powered by Disqus

Documentation generated on Sun, 19 Oct 2008 06:39:02 +1300 by phpDocumentor 1.3.2