Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

Danp feajax

From TYPO3Wiki
Jump to: navigation, search
Extension detail information
danp_feajax
A shop extension
documentation state draft document state list
licence OCL
forgeproject
mailinglist
usergroups list of usergroups forAdmins, forDevelopers, forIntermediates
author(s) Daniel Pötzinger
TER category fe
dependency

<< Back to Extension manuals page

[edit]


Introduction

It's a FE AJAX framework for barrier free web applications.

What does it do?

This extension is a framework to build clean and barrier free Ajaxapplications, meant to be helpful for extension developers. It is neccessary to understand the principles, which is explained in this document.

For an example use danp_feajaxexample

Screenshots

Example Frontend plugin see extension "fe ajax framework example": Feajaxexample.png

Abstrakt View of a web site

Contains content elements (=CE). CE can be a interactive CE (=ICE) or a dynamic CE (=DCE).

Properties:

  • CE: have a unique name (Id)
  • ICE: they have links or forms to interact with the user
  • DCE: they change content depending on user actions

Feajax uml1.jpg

In terms of MVC Patter this means:

  • View: Content elements
  • Control: Interactive CE, controls which parts of view changes
  • Model: application logic (part of plugin)

Framework Introduction

Users manual

Feajax uml.jpg


FAQ

Adminstration

FAQ

Configuration

FAQ

Typoscript Reference

Common configuration of elementloader

Property: Data type: Description: Default:
config.ajaxElementloaders.<key>

config.ajaxElementloaders.default

Elementloader configuration Define the elementloaders (defined by key. Default Elementloader defined in key default)

[config.ajaxElementloaders]

Property: Data type: Description: Default:
path string Path to the Elementloader File.
className string The classname of the elmentloader (defined in path)

[Elementloader configurations]

Example Typoscript
config.ajaxElementloaders {
 danp_fonds {
  path=EXT:danp_fonds/class.tx_danpfonds_elementloader.php
  className=tx_danpfonds_elementloader
 }
 default {
  path=EXT:danp_fonds/class.tx_danpfonds_elementloader.php
  className=tx_danpfonds_elementloader
 }
}

FE Services

Property: Data type: Description: Default:
ceId string Name (Identifier) of the ContentElement which should be shown
piVarsPrefix string prefix Id, used to set the piVars from GET/POST

[getContentElement Service]

Example: Tricky: Use uncached Contentelements

It is very useful to include CE's where you want to output something independently from site cache. So you can use the _INT TS-Objects to get uncached content:

test=USER_INT
test {
 userFunc=tx_danpfeajax_service->getContentElement
 ceId=note
 piVarsPrefix=tx_danpfonds_pi1
}

you can use this also to fill a marker with uncached content (while the rest of the output is cached)

$marker['###REMEMBER###']=$GLOBALS['TSFE']->cObj->cObjGetSingle('USER_INT',$conf);

Tutorial

How does a ajax link look like

There are some parameters which are passed:

  • name of the ICE class which should be instanciated (and which controls the actions)
  • name of the elementloader (optional) "elname" (see configuration)

Using more than one Elementloader

Two possible ways:

  1. just use independent Elementloaders by using elname and defining them in config.ajaxElementloaders...
  2. To extend a existing elementloader you can use this concept:

Just define new CE in your new extension and add a new "definitions.php" file. Now only the existing elementloader have to know them. You can do this by:

$this->addCEDefinitions(t3lib_extMgm::extPath('fonds_rememberlist').'ce/definitions.php');

(You can add your own hook for that in your elementloader)

Using Forms

The Framework is ready to work with GET or POST. A POST call with parameters from the form with id "noteform" can be called with:

xajaxCall('notecontrol','POST:noteform',true,'note') >

Use this example code in your CE:

$content .=$this->linkHelperObj->getHiddenFields();
if ($this->isAjax) 
 $content .='<input type="button" onclick="'."xajaxCall('notecontrol','POST:noteform',true,'note')".'" value="Notiz speichern">';
else
 $content .='<input type="submit" value="Notiz speichern">';

MVC ?

This Framework helps to easily programm in MVC Pattern:

  • use DCE as View
  • use ICE as Controler

Known problems

To-Do list

Changelog

0.1.0 * Initial release

0.1.1 * fix BUG with logout of users

0.1.2. * add basic support for forms

0.1.3 * add support for more than one elementloader * bugfixes * getLink allows to return only A tag parameters now (thanks Markus Thiele for the hint)

Whishlist