[TYPO3-dev] xaJax update 0.2.3 available
Elmar Hinz
elmar.DOT.hinz at team.MINUS.red.DOT.net
Tue Mar 21 14:13:20 CET 2006
Joerg Schoppet schrieb:
> Hi Elmar,
>
> do you have any examples how to implement this cool stuff in a frontend extension?
>
> The ext "xajax_example" only handles the backend. I've digged around, but I think my brain is stuck somewhere :-(
>
> Regards
> Joerg Schoppet
Hi Joerg,
there is no public example yet. Keep in mind that there are differnt
calls to your script:
a) The regular call.
b) The call via xajax request wich needs an xajax response.
1.) First build your extension without ajax.
2.) Then point out wich part(s) of your usual code you wan't to
deliver isolatet.
3.) Bring this part(s) into an own function, so that it can be called
a) from the normal controller
b) from the registered ajax function(s), that is/are responsible
to send it isolated.
4.)
a) create your xajax instance
b) configure your instance:
$xajax->setCharEncoding("iso-8859-1");
$xajax->setRequestURI(
t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT') . '?' .
htmlspecialchars(t3lib_div::getIndpEnv('QUERY_STRING') ) );
etc.
b) Register your function(s) in your controller: see xajax_example
5.) Call $this->xajax->processRequests() from your controller.
(Here the xajax Response is done by calling your registered
functions and exits after.)
6.) To output JS in regular call:
$js = $xajax->getJavascript(t3lib_extMgm::siteRelPath("xajax")
. 'xajax/');
7.) Implement the registered functions:
See other mails in this thread.
I hope this helps.
Regards
Elmar
More information about the TYPO3-dev
mailing list