[TYPO3-formidable] sandbox and persitance after the FORM post.
Didier HINGANT
didier.hingant at wanadoo.fr
Wed Aug 3 16:37:19 CEST 2011
Hello all of you,
I've got a renderlet lister populated with a list of filenames.
In that lister i put a renderlet:Checksingle column to select or not
a file name in that list.
<column type="renderlet:CHECKSINGLE" name="cbselect" activeListable="true"
defaultWrap="false" listHeader="Selection">
<onchange runat="ajax"
params="rowData::uid,mylist.cbselect,rowData::fl_identifiantftype,rowData::fl_nomfichier"
>
<userobj>
<php><![CDATA[/*<?php*/
return $this->oSandBox->doAfterCheck();
/*?>*/]]>
</php>
</userobj>
</onchange>
</column>
Each time i select or deselect a record in the renderlist, i
update an array (addArray or delArray) called $liste_fichier that i store
in a sandbox var by that function :
function addArray($uid, $numdossier, $nomfichier) {
if(is_null($this->oForm->oSandBox->iCounter)) {
$iCounter=0;
$this->oForm->oSandBox->iCounter = $iCounter;
}
else {
$iCounter=$this->oForm->oSandBox->iCounter;
$iCounter++;
$this->oForm->oSandBox->iCounter = $iCounter;
}
// Test pour savoir si le tableau liste_fichier existe en memoire sandbox
if(is_null($this->oForm->oSandBox->liste_fichier)) {
$liste_fichier[$iCounter]["uid"]=$uid;
$liste_fichier[$iCounter]["fl_identifiantftype"]=$numdossier;
$liste_fichier[$iCounter]["fl_nomfichier"]=$nomfichier;
$this->oForm->oSandBox->liste_fichier = $liste_fichier;
}
else {
$liste_fichier=$this->oForm->oSandBox->liste_fichier;
}
$liste_fichier[$iCounter]["uid"]=$uid;
$liste_fichier[$iCounter]["fl_identifiantftype"]=$numdossier;
$liste_fichier[$iCounter]["fl_nomfichier"]=$nomfichier;
$this->oForm->oSandBox->liste_fichier = $liste_fichier;
}
I want to retrieve the $liste_fichier in the actionlet part of my xml after
the form post :
<actionlet:USEROBJ>
<userobj>
<php><![CDATA[/*<?php*/
//$actionLetMsg="Passage dans Actionlet!";
//debugster($actionLetMsg,array("title"=>"ActionLet","recursion"=>"10"));
$filelist = $this->oForm->oSandBox->liste_fichier;
debugster($filelist,array("title"=>"liste fichiers
actionLet","recursion"=>"10"));
]]>
</php>
</userobj>
</actionlet:USEROBJ>
</actionlets>
My problem is that the sandbox var 'liste_fichier' is always null after i
click the submit button.
Are sandbox vars persistants after a submit form ?
If someone could give me an explanation or an example with sandbox vars and
functions.
Thank you very much.
Didier.
More information about the TYPO3-project-formidable
mailing list