[TYPO3-project-formidable] Lisbox and default value in edition : A solution?

Sanosuke303 sanosuke303 at yahoo.fr
Fri May 16 11:13:42 CEST 2008


Bonjour Jérome,

Je me permets d'écrire en français puisque je sais que tu es toi aussi français, je pourrais ainsi mieux t'expliquer mon problème

Tout d'abord, merci beaucoup d'avoir pris le temps de me répondre, et bravo pour ton extension.

Pour prendre un exemple simple à mon problème, prenons la table fe_users.

Admettons que j'édite un user. Le champs nom apparaît (dans un renderlet text) avec le nom de l'utilisateur. Si je souhaite afficher le usergroup, cela marche bien sur dans un renderlet text et j'aurais l'ID du group.

Ce que je veux faire, c'est afficher la liste de tous les usergroup (ça j'y arrive) puis que le usergroup de l'user soit selectionné par défaut.

              <userobj>  
                  <php><![CDATA[  
                        
                      return $GLOBALS["TYPO3_DB"]->exec_SELECTgetRows(  
                          "uid as value, title as caption",  
                          "fe_groups ",  
                          "pid=4",  
                          "",  
                          "caption ASC"  
                      );  

                  ]]></php>  
              </userobj> 

Cela permet à l'administrateur de changer facilement de usergroup en visualisant le usergroup actuel.
Donc je n'arrive pas à selectionner par défaut le group de l'utilisateur courant en mode edit.

Voilà, j'espere avoir été plus clair.

Encore merci pour ton aide et vraiment bravo pour cette super extension!

PS: Penses-tu être présent à la T3 univ?


--- En date de : Jeu 15.5.08, Jerome Schneider <typo3dev at ameos.com> a écrit :

> Hi Sanosuke,
> 
> If I understand well, you want to override the data that
> the framework 
> loads from the database, when in edition mode.
> 
> You'll have to use /data/value on the renderlet,
> instead of 
> /data/defaultvalue
> 
> like this:
> 
> <renderlet:LISTBOX name="mylist"
> label="The listbox">
> 	<data value="two">
> 		<items>
> 			<item caption="The first"
> value="one" />
> 			<item caption="The first"
> value="two" />
> 			<item caption="The first"
> value="three" />
> 		</items>
> 	</data>
> </renderlet:LISTBOX>
> 
> 
> note the <data value="two"> instead of
> <data defaultValue="two">
> 
> Hope this answers
> Jerome
> 
> Sanosuke303 wrote:
> > Hi list,
> > 
> > I use formidable and I'm trying to use the edition
> > mode.
> > 
> > So, I have a listbox that allow user to choose a
> value. But
> > when I try to show the database value with the
> "default
> > value", it does'nt work.
> > 
> > I have read in the documentation that it is not
> allowed :
> > "If set, it will be used only when the form has
> not
> > been already submitted ( first display ) and when in
> > creationmode ( not edition mode)"
> > 
> > How can I show a listbox in edition mode with the good
> > value selected?
> > 
> > Regards.
> > 
> > PS: I'm sorry but my english is not good enought
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > En finir avec le spam? Yahoo! Mail vous offre la
> meilleure protection possible contre les messages non
> sollicités 
> > http://mail.yahoo.fr Yahoo! Mail 
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable

__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail 


More information about the TYPO3-project-formidable mailing list