[TYPO3-project-formidable] Refresh and dynamic listbox

Izzie Greys izzie.greys at gmail.com
Tue Jul 22 14:21:51 CEST 2008


My formidable version is the 1.0.183. When I test your example it works nice
too. But mine bugs. Maybe because of sql ? But I don't because it works on
Firefox. Do you know why it can bug and be blocked ?

What I have done :

<renderlet:LISTBOX name="rubrique" label="Rubrique">
      <onchange runat="ajax" params="rubrique">
          <userobj>
               <php><![CDATA[/*<?php*/
                     $sRub = $this->oMajixEvent->getParam("rubrique");
                     $this->aORenderlets["rubrique"]->setValue($sRub);
                     $aItems =
$this->aORenderlets["categorie"]->_getItems();
                     return
$this->aORenderlets["categorie"]->majixReplaceData($aItems);
                /*?>*/]]></php>
          </userobj>
      </onchange>
      <data>
           <defaultvalue first="true" />
                 <userobj>
                      <php><![CDATA[/*<?php*/
                           return
$GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, nom as
caption","table_rubriques","","nom","");
                            /*?>*/]]></php>
                </userobj>
       </data>
</renderlet:LISTBOX>
<renderlet:LISTBOX name="parent_category" label="Catégorie">
       <data>
             <items>
                  <item caption="" value=""/>
             </items>
             <userobj>
                   <php><![CDATA[/*<?php*/
                           $sRub =
$this->aORenderlets["rubrique"]->getValue();
                           if(intval($sRub) > 0)
                           {
                               $where .= "rubrique = '".$sRub."'";
                               return
$GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, label as
caption","table_categories",$where,"label","");
                                    }
                  /*?>*/]]></php>
            </userobj>
      </data>
</renderlet:LISTBOX>

Regards,

2008/7/22 Jerome Schneider <typo3dev at ameos.com>:

> Hi again :)
>
> Which version of Formidable are you using ?
> I tested on IE6 and it works nice.
>
> Greetings
> Jerome
>
> Izzie Greys a écrit :
> > Hey Jerome,
> >
> > Thank you so much for the example. It was very useful. It was exactly
> what I
> > want to do, I just replace php array by sql request and it's nearly
> perfect..
> > Nearly because there is just a strange problem on IE6 (it's perfect with
> > Firefox). When I select a "rub" item, for some of them, it's loading,
> > loading (ajax image).... and nothing happens. The "subrub" isn't loaded.
> But
> > it works for few of them. That's weird isn't it ?
> >
> > 2008/7/22 Jerome Schneider <typo3dev at ameos.com>:
> >
> >> Hi Izzie,
> >>
> >> I think avoiding page-refresh thanks to ajax might help you out.
> >>
> >> I placed an example there for your understanding:
> >> http://formidable.typo3.ug/tutorials/nested-listboxes.html
> >>
> >> Please tell if you encounter any problem with this.
> >>
> >> Regards,
> >> Jerome
> >>
> >>
> >> Izzie Greys a écrit :
> >>> Hi, it's me again. I'm sorry to bother you with my problem but I really
> >> ned
> >>> your help. I have made some change and now the form is entirely working
> >> in
> >>> edition mode but it's still not working in creation mode. Problems are
> >>> still:
> >>> 1 - If I click on the create 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 - 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 understand this redirection ?!? Why ? I'm confuse.
> >>>
> >>> My new code:
> >>> <renderlet:LISTBOX name="rubrique" label="Rubrique">
> >>>    <onchange refresh="true"/>
> >>>       <data>
> >>>            <userobj>
> >>>                 <php>
> >>>                      <![CDATA[
> >>>                          return
> >>> $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, nom as
> >>> caption","table_rubrique","","nom","");
> >>>                      ]]>
> >>>                 </php>
> >>>            </userobj>
> >>>      </data>
> >>> </renderlet:LISTBOX>
> >>>
> >>> <renderlet:LISTBOX name="parent_category" label="Catégorie">
> >>>       <onchange refresh="true"/>
> >>>            <data>
> >>>                 <items>
> >>>                        <item caption="" value=""/>
> >>>                 </items>
> >>>                 <userobj>
> >>>                       <php>
> >>>                            <![CDATA[
> >>>                                 $iRubrique =
> >>> $this->oDataHandler->_getThisFormData("rubrique");
> >>>                                 if(intval($iRubrique) > 0)
> >>>                                 {
> >>>                                 $where .= "rubrique='".$iRubrique."'";
> >>>                                 return
> >>> $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows("uid as value, label as
> >>> caption","table_categorie",$where,"label","");
> >>>                             }
> >>>                           ]]>
> >>>                       </php>
> >>>                </userobj>
> >>>        </data>
> >>> </renderlet:LISTBOX>
> >>>
> >>> Thanks for reading.
> >>> Regards,
> >>> Izzie
> >>>
> >>> 2008/7/18 Izzie Greys <izzie.greys at gmail.com>:
> >>>
> >>>> 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.
> >>>> _______________________________________________
> >>>> TYPO3-project-formidable mailing list
> >>>> TYPO3-project-formidable at lists.netfielders.de
> >>>>
> >>>>
> >>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
> >>
> >> --
> >>
> >>
> >> *Jérôme Schneider*
> >> /Developer/
> >> /Formidable - Rapid Application Developpement Framework for Typo3
> >> <http://formidable.typo3.ug>/
> >> /Ameos <http://www.ameos.com>/
> >> _______________________________________________
> >> TYPO3-project-formidable mailing list
> >> TYPO3-project-formidable at lists.netfielders.de
> >>
> >>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
> >>
>
>
> --
>
>
> *Jérôme Schneider*
> /Developer/
> /Formidable - Rapid Application Developpement Framework for Typo3
> <http://formidable.typo3.ug>/
> /Ameos <http://www.ameos.com>/
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
>
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
>


More information about the TYPO3-project-formidable mailing list