[TYPO3-mvc] textareaRTE viewhelper

Daniel Dimitrov danielsd_bg at yahoo.fr
Wed Aug 11 11:35:34 CEST 2010


Hey Frank,
it is great to see that you and Bastian are working on incorporating this 
into the core :)
I know that it will get some time so I'm trying to go on alternative way :)

If I have the code in my own viewhelper nobody is going to care if I follow 
the coding guidelines or not :)

Anyway as I see the only thing preventing this viewhelper to work are the 
modifications made to formviewhelper.

if 
($this->viewHelperVariableContainer->exists('Tx_Fluid_ViewHelpers_Form_RteViewHelper', 
'rte')) {
+			foreach 
($this->viewHelperVariableContainer->get('Tx_Fluid_ViewHelpers_Form_RteViewHelper', 
'rte') as $key => $js) {
+				if ($key == 0) {
+					$rtePre = $js['pre'];
+				}
+				$rteSubmit .= $js['submit'];
+
+				// Due to bug 15250 (http://bugs.typo3.org/view.php?id=15250) the rte 
adds
+				// 'style="visibility: visible; display: block;"' inside the script tag 
(firefox).
+				// With '<span></span>' this doesn't happen.
+				// It was fixed in TYPO3 v 4.4.1.
+				//$rtePost .= '<span></span>'.$js['post'];
+				$rtePost .= $js['post'];
+
+
+			}
+			$this->tag->addAttribute("onsubmit", 
$this->arguments['onsubmit'].$rteSubmit, TRUE);
+			$content = $rtePre . $this->tag->render() . $rtePost;
+		} else {
+			$content = $this->tag->render();
+		}
+

What I wonder here is - isn't there any way to get the formViewHelper and 
set the onsubmit tag???

Kind regards,
Daniel

 "Frank Frewer" <info at frankfrewer.de> wrote in message 
news:mailman.1.1281425636.6492.typo3-project-typo3v4mvc at lists.typo3.org...
> Hello Daniel,
>
> Daniel Dimitrov schrieb:
>> Hey Frank,
>>
>> "Frank Frewer" <info at frankfrewer.de> wrote in message 
>> news:mailman.1.1281087934.7686.typo3-project-typo3v4mvc at lists.typo3.org...
>>> Hello Daniel,
>>>
>>> today I created a suggestion for a RteViewHelper on Forge / 
>>> Fluid-ViewHelper-Incubator: http://forge.typo3.org/issues/9179
>>> There I attached a file RteViewHelper.php and a patch for the 
>>> FormViewHelper.
>>>
>>> Maybe this can help you a bit. And maybe we can merge some codings to 
>>> make it better.
>>>
>>> Kind regards,
>>>
>>> Frank
>>
>> to 90% our code looks the same, but the 10% really make the big jump :)
>>
>> It is really cool! I've tested your code and it works -
>
> I like to hear that.
>
>> now I don't have to use
>> @dontvalidate request hash, extbase doesn't complain of a new 
>> transform_property.
>>
>> For me it is perfect :) I hope that your helper will be accepted in hte 
>> core.
>
> I hope so too.
>
> Kind regards
>
> Frank
>
>> Cheers,
>> Daniel
>>>
>>>
>>>
>>> Daniel Dimitrov schrieb:
>>>> Hey @ll,
>>>> I'm currently trying to create a textarea with the RTE editor.
>>>> As a base for my Viewhelper I use the standard textarea viewhelper and 
>>>> the test_rtefe extension.
>>>> After a lot of tricks and hacks :D I managed to get the RTE area 
>>>> showing.
>>>>
>>>> The first problem I got was when trying to save the form.
>>>> I got the Tx_Extbase_MVC_Exception_InvalidArgumentValue exception, 
>>>> because the RTE js was creating
>>>> a hidden field _TRANSFORM_description with value="RTE"
>>>>
>>>> I've defined this in my model:
>>>>     /**
>>>>      *
>>>>      * @var string
>>>>      */
>>>>     protected $_TRANSFORM_description;
>>>>
>>>>     public function set_TRANSFORM_description($test) {
>>>>         $this->_TRANSFORM_description = $test;
>>>>     }
>>>>
>>>> and now I got the next exception 
>>>> Tx_Extbase_MVC_Exception_InvalidOrNoRequestHash.
>>>> I've put @dontverifyrequesthash on my new and create actions and now 
>>>> the form is being sent and no error message is shown.
>>>> However my description field (the one with the RTE) is not saved.
>>>>
>>>> When I use the standard f:form.textarea viewHelper then the text in the 
>>>> textarea is saved. Any ideas what could be wrong?
>>>>
>>>> Kind regards,
>>>> Daniel
>> 


More information about the TYPO3-project-typo3v4mvc mailing list