[TYPO3-project-formidable] Refresh and dynamic listbox

Izzie Greys izzie.greys at gmail.com
Fri Jul 18 14:45:08 CEST 2008


Hello list,

I have another question for you about the edit/creation form and the action
<onchange refresh="true"/> on the renderlet listbox. Here it's my problem.
In my edit form/creation form I have a renderlet listbox like this one:

<renderlet:LISTBOX name="rubrique" label="Rubrique">
     <onchange refresh="true"/>
     <data>
            <userobj>
                  <php>
                      <![CDATA[
                            return
$GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, label as
caption","table_rubrique","","","");
                      ]]>
                 </php>
            </userobj>
      </data>
</renderlet:LISTBOX>

When I select one element of the list my second listbox is updated:

<renderlet:LISTBOX name="categorie" label="Catégorie">
     <data defaultvalue="">
          <items>
                <item caption="" value=""/>
          </items>
          <userobj>
               <php>
                   <![CDATA[
                        $iRubrique =
$this->oDataHandler->_getThisFormData("rubrique");
                        if(intval($iRubrique) > 0)
                        {
                            $where .= "parent='".$iRubrique."'";
                            return
$GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, label as
caption","table_categorie",$where,"","");
                        }
                  ]]>
              </php>
          </userobj>
     </data>
</renderlet:LISTBOX>

My problems are:
1 - If I click on the create button or edit button on the page where is my
renderlet lister, my listbox "rubrique" is ok but my listbox "categorie" is
empty. I would like it contains the elements in relation with the "rubrique"
selected.
2 - The other problem concern the create form. If I select a element of the
listbox "rubrique", my form is closed and I'm redirected on my lister.
Nothing is created. But it works fine with the edit form. I select an
element in the listbox "rubrique" and the listbox "categorie" is updated.

I don't know how to resolve these problems. I hope you can help me.

Thanks in advance and have a good day.


More information about the TYPO3-project-formidable mailing list