[TYPO3-dev] Unable to access FlexForm settings in controller on AJAX request
Rakesh Dodda
rakeshdodda.rd at gmail.com
Thu Oct 31 16:43:21 CET 2013
Hi all,
I'm fairly new in building extension in TYPO3, please be patient and help
me solve my issue. Any help on this will be really great :)
I'm having trouble in accessing my FlexForm settings while making a normal
AJAX call (without eID). I'm able to access the FlexForm settings otherwise
using *$this->settings *without any AJAX.
*
*
The following are the things I followed:
Added the FlexForm. It looks like this:
<T3DataStructure>
> <meta>
> <langDisable>1</langDisable>
> </meta>
> <sheets>
> <sDEF>
> <ROOT>
> <TCEforms>
> <sheetTitle>View Settings</sheetTitle>
> </TCEforms>
> <type>array</type>
> <el>
> <switchableControllerActions>
> <TCEforms>
> <label>Select type</label>
> <config>
> <type>select</type>
> <items>
> <numIndex index="0">
> <numIndex index="0">Ext
> View</numIndex>
> <numIndex
> index="1">MyExt->list</numIndex>
> </numIndex>
> </items>
> </config>
> </TCEforms>
> </switchableControllerActions>
> <settings.flexform.limit>
> <TCEforms>
> <label>Number of items</label>
> <config>
> <type>input</type>
> <size>10</size>
> <eval>num</eval>
> </config>
> </TCEforms>
> </settings.flexform.limit>
> </el>
> </ROOT>
> </sDEF>
> </sheets>
> </T3DataStructure>
My AJAX TS in the file ext_typoscript_setup.txt is as follows:
plugin.tx_myext {
> ajax = PAGE
> ajax {
> config {
> disableAllHeaderCode = 1
> disablePrefixComment = 1
> xhtml_cleaning = 0
> admPanel = 0
> no_cache = 1
> additionalHeaders = Content-type:application/json
> metaCharset = utf-8
> }
> }
> }
> tx_myext_ajax_page < plugin.tx_myext.ajax
> tx_myext_ajax_page {
> typeNum = 99
> 10 < tt_content.list.20.myext_myext
> }
The following TS code is written in the Template of my Backend Page:
plugin.tx_myext {
> settings{
> resourcePath=fileadmin/project/templates
> ImagePath=fileadmin/project/images/
> }
> }
The actions in my controller are:
*This prints everything:*
public function listAction(){
> print_r($this->settings);
> }
*The Ajax Update action , this prints only the settings given in my
Template of the backend page*
*
*
> public function updateAction(){
> print_r($this->settings);
> }
I tried removing the TS code from the template backend page, it still gives
the same issue.
I tried adding the following TS to my* ext_typoscript_setup.txt *but still
gives me the issue:
> tx_myext_ajax_page {
> typeNum = 99
> 10 {
> settings =< tx_myext.settings
> }
> }
Kindly help me in solving this. As mentioned earlier, any help would be
really great.
--
Regards,
Rakesh Dodda
More information about the TYPO3-dev
mailing list