Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom CMSAction - HTMLText Fields Form Submit


Go to End


2 Posts   2099 Views

Avatar
Matze0681

Community Member, 25 Posts

2 September 2010 at 9:48am

hi everybody,

i added a custom cms-action to a managed model in modelAdmin. (Add new button next to the standard Save,Back and Delete Button). Now i need to process the form in the extended ModelAdmin_RecordController (this is where the form action is). Everythig works like it should but HTMLText Fields from the DataObject...
If i look into the $_REQUEST var every field appears with its correct values, but HTMLText Fields only contains the correct value if i saved the DataObject(ManagedModel) before i fire the CustomCMS Action.

I can change field values from any other field and it works fine..($_REQUEST values are correct also without saving the object first)

Is there a special behaiviour with the tinymce htmltext field and form submits ? somebody got the same problem before ?

thanks
matze

Avatar
PGiessler

Community Member, 47 Posts

12 September 2010 at 8:29pm

Hi Matzeo681,

that is right. There is a special behaviour of TinyMCE in the HTMLEditorField. TinyMCE generates an iframe and all input will be there.
If you click the CMS_Save Action, a Javascript function will be execute. This function, called TinyMCE.triggerSave(), copy all the content of the iframe in the hidden textarea.

Best,
Pascal