[TYPO3-project-formidable] HOWTO get the cruser_id, .

Jerome Schneider typo3dev at ameos.com
Thu Sep 21 19:52:04 CEST 2006


Hi Jeremy,

If you're using the pre-v0.6 formidable, you can't use anymore the 
"defaultvalue" property on a PASSTHRU.

We had to change this because it makes no sense to use a defaultvalue on a 
field that users can't modify, and we had a lot of problems trying to 
implement this.

Try to use "value" instead, this should fix the problem.

If you need a value that has to be hidden, but still modifiable at runtime 
by the user, you should rather use the renderlet:HIDDEN, because it can 
manage value & defaultvalue.


The PASSTRHU's job is just to inject data into the datahandler at runtime, 
and has nothing to do with the form itselves ( really useful, for instance, 
for injecting cruser_id, pid, tstamp, crdate, ... in your database ).






If, for security reasons, you still preafer that the hidden value doesn't 
transit at all in the form HTML, you implement something like this :
(i also included this code into a flie joint to this mail )

<renderlet:LINK>
    <label>Click me if you want to change the passthru value</label>
    <onclick runat="server"when="after-init-datahandler">
        <userobj>
            <php><![CDATA[

                    $this->aORenderlets["mypassthrurdt"]->setValue(
                        "SOMETHING ELSE"        // passthru 'mypassthrurdt' 
value changed at runtime if user clicks on the link
                    );

            ]]></php>
        </userobj>
    </onclick>
</renderlet:LINK>

<renderlet:PASSTHRU name="mypassthrurdt" value="SOMETHING" />


Hope this helps ;)


PS : for those who have red the "Official form library" thread : don't 
worry, we won't drop the project, we will continue to improve formidable for 
a looooooong time :)

"Jérémy Lecour" <jeremy.lecour at gmail.com> a écrit dans le message de news: 
mailman.9699.1158855653.6429.typo3-project-formidable at lists.netfielders.de...
Hi

I have a form with some PASSTHRU fields at the end, like this one :
<renderlet:PASSTHRU name="cruser_id">
<data>
<defaultvalue>CURRENT_USERID</defaultvalue>
</data>
</renderlet:PASSTHRU>

I'm making an ACTIONLET that has to deal with form data after it is
submitted. I'm able to catch the form data with "$aData =
$this->oForm->oDataHandler->_getFormData();" but the PASSTHRU fields
are empty at this step of the process.

Maybe I'm missing something or even I'm wrong using an ACTIONLET for
this job but would rather using a DATAHANDLER. The purpose is to
update the "fe_user" record that is filling the form.

Thanks for any tip.

-- 
Jérémy Lecour : <mailto:jeremy.lecour at gmail.com>
webdesigner, webmaster et développeur web
Trésorier du PLUG : Provence Linux User Group
http://www.plugfr.org/ 


begin 666 server_event+passthru.xml
M/')E;F1E<FQE=#I,24Y+/@T*(" @(#QL86)E;#Y#;&EC:R!M92!I9B!Y;W4@
M=V%N="!T;R!C:&%N9V4@=&AE('!A<W-T:')U('9A;'5E/"]L86)E;#X-"B @
M(" \;VYC;&EC:R!R=6YA=#TB<V5R=F5R(G=H96X](F%F=&5R+6EN:70M9&%T
M86AA;F1L97(B/@T*(" @(" @(" \=7-E<F]B:CX-"B @(" @(" @(" @(#QP
M:' ^/"%;0T1!5$%;#0H)"0D)"0T*"0D)"0DO+R!P87-S=&AR=2 G;7EP87-S
M=&AR=7)D="<@=F%L=64 at 8VAA;F=E9"!A="!R=6YT:6UE(&EF('5S97(@8VQI
M8VMS(&]N('1H92!L:6YK#0H-"B @(" @(" @(" @(" @(" @(" @)'1H:7,M
M/F%/4F5N9&5R;&5T<ULB;7EP87-S=&AR=7)D=")=+3YS971686QU92 at -"B @
M(" @(" @(" @(" @(" @(" @(" @(")33TU%5$A)3D<@14Q312(-"B @(" @
M(" @(" @(" @(" @(" @*3L@(" @(" @(" @(" @(" @#0H-"B @(" @(" @
M(" @(%U=/CPO<&AP/@T*(" @(" @(" \+W5S97)O8FH^#0H@(" @/"]O;F-L
M:6-K/@T*/"]R96YD97)L970Z3$E.2SX-"@T*/')E;F1E<FQE=#I005-35$A2
K52!N86UE/2)M>7!A<W-T:')U<F1T(B!V86QU93TB4T]-151(24Y'(B O/@``
`
end




More information about the TYPO3-project-formidable mailing list