[TYPO3-project-formidable] Can't update rtd:TEXT field value when using userobj for value
Andres Toomsalu
andres at active.ee
Mon Jan 26 15:10:37 CET 2009
Hi Jerome,
Thank you for a quick answer. However my main problem is that I don't
have database field named as rdt:TEXT field - instead I need to parse
info from one db field into several form fields (by extracting info for
fields with php function). All I want to do is to have form persistance
(fields are prefilled what data parsed from database) and to be able
edit field by hand and return values on submit (I'm doing recombining
several form fields into one db field on beforeInsertion - removing
afterwords unneeded fields from $aData).
Here is a simple example:
1) Create and edit form has several event recurrance pattern fields like
this: weekday (select), time (txt)
2) On submit their values are recombined into single db field
'recursion' like 'M1300,T1400,W1500'
3) When form is loaded for edition I load data from db with
_getStoredData and parse its 'recursion' db field with sandbox function
- giving each selectbox and text field its value.
So if rdt:TEXT userobj value overrides form one - then I probably would
need to inject parsed recursion field data into form data array on form
load - so I wouldn't need rdt:TEXT userobj for value at all.
Is it possible to inject data into form data array when form is being
loaded for edition - so that fields could display parsed data as normal
with database fields?
Jerome Schneider wrote:
> Hi Andres,
>
> /data/value *always* overrides the current value of any renderlet
>
> /data/defaultValue is applied only when displaying your form for the
> first time (and also while not editing a record); next submits will use
> the submitted value
>
> So you should use /data/value to achieve what you describe.
>
> Note that you may well define a userobj on defaultvalue, of course.
> And also note that, in your example, the data set on defaultValue is
> overriden with the data returned by /value.
>
> Best regards,
> Jerome Schneider
>
> PS: you'll find an incomplete and temporary reference documentation at
> this address: http://wiki.typo3.org/index.php/Formidable_reference
>
>
> Andres Toomsalu a écrit :
>
>> Hello,
>>
>> I'm trying to use renderlet:TEXT with value filled with php userobj -
>> but I'm then unable to change the value with form field. After form
>> submit it still submits userobj value not the one on the form field. Is
>> it intentional or is it bug? Any workarounds?
>>
>> <renderlet:TEXT name="reTime1" label="LLL:reTime">
>> <data defaultvalue="00:00">
>> <value>
>> <userobj>
>> <php><![CDATA[
>>
>> $fieldStr = 'Hello';
>> return $fieldStr;
>>
>> ]]></php>
>> </userobj>
>> </value>
>> </data>
>> </renderlet:TEXT>
>>
>> Best regards,
>>
> _______________________________________________
> 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