[TYPO3-formidable] help with xmlbuilder and "params" in a dynamic xml array!

Didier HINGANT didier.hingant at wanadoo.fr
Mon Jul 4 18:44:30 CEST 2011


Hello,

I've got some problems using xml builder when i build a dynamic list of 
"renderlets:LINK"

I want to use codebehind and pass some parameters to a function with an ajax 
request.

But when i get to get those parameters with 
'$this->oForm->oMajixEvent->getParams()',
i'm just able to see only 1 char in the result array.

I'm sure that the only char that i can see, is the value of the record, and 
not an array of (key_record,value_record).
and i want to pass some "params" coming from the results datas of the sql 
request.

Here my app, if someone can give me his feedback about that problem?

*****************************************************************
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<formidable version="2.0.505">

  <meta>
     <name>Application Gestion Dossiers</name>
     <form formid="gestion_process"/>
     <codeBehind type="php" name="gestion_process" 
path="fileadmin/formidable/applications/Administration/class.gestion_process_0.1.php:gestion_process" 
/>
     <displaylabels>true</displaylabels>
     <debug>1</debug>
     <libs>scriptaculous</libs>
  </meta>

  <control>

    <datahandler:VOID />

    <renderer:STANDARD />

  </control>

  <elements>
     <xmlbuilder>
       <userobj>
         <php><![CDATA[

            $datasArray = 
$GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*','tx_process','uid=1');

            //debugster($datasArray,array("title"=>"workflow 
Datas","recursion"=>"10"));

            $aXml = array();

            // On traite le tableau de donnees rendu par la requete.
            // Le tableau rend le workflow sequentiel de scripts a executer.
            reset($datasArray);

            while(list($Phasenum, $InfoPhase) = each($datasArray)) {
              debug($Phasenum.' '.$InfoPhase,'liste'.$Phasenum);
              debugster($InfoPhase);

              $icon='<img 
src="fileadmin/formidable/applications/Administration/images/process_9050.png" 
title="'.$InfoPhase[pr_description].'"'.'>';

              $aXml["renderlet-workflow-".$Phasenum] = array(
                                                             "type" => 
"LINK",
                                                             "name" => 
$Phasenum,
                                                             "cache" => 
"false",
                                                             "syncvalue" => 
"true",
                                                             "label" => 
$icon,
                                                             "style" => 
"cursor: pointer",
                                                             "onclick" => 
array(
                                                                             
    "runat"=>"ajax",
                                                                             
    "exec"=>"gestion_process.btnClick_Phase()",
                                                                             
    "params"=>array(
                                                                             
               "pr_nom"=>$InfoPhase[pr_nom])
                                                                             
    )
                                                             );

            }

            //debugster($aXml,array("title"=>"XmlElements","recursion"=>"10"));
            return $aXml;
            ]]>
         </php>
       </userobj>
     </xmlbuilder>
  </elements>

</formidable>

***************************************************************

In my example, i'm just passing one parameter to the codebehind, but i would 
like to be able to pass
more paraemeters to the php script.

Thanks very much for your help.

Regards.

Didier. 




More information about the TYPO3-project-formidable mailing list