tinymce / tinymce-blazor

Blazor integration
MIT License
45 stars 13 forks source link

using Editor in EditForm #62

Closed alizalevinger closed 1 year ago

alizalevinger commented 1 year ago

Hi, I was so excited to find this blazor wrapper for tinymce. How can I integrate inside of an EditForm. I'm getting the following error: System.Exception: Editor is used inside and EditForm but field accessor: "Field" parameter is not specified. at TinyMCE.Blazor.Editor.EnsureForParamWhenUsedInEditForm() at TinyMCE.Blazor.Editor.OnParametesSet()....

exalate-issue-sync[bot] commented 1 year ago

Ref: INT-3141

jscasca commented 1 year ago

If you are inside an EditForm you need to specify the Field property. You can find an example of this in the README: https://github.com/tinymce/tinymce-blazor#enable-form-validation

This will allow the form to access the value of the component. Hope this helps!

alizalevinger commented 1 year ago

Thanks! I'll give it a try

alizalevinger commented 1 year ago

Can you clarify what the difference is between Field and bind-Value in this case? What are they each doing? I thought bind-value was enough to accomplish data binding. What is the Field value for?

jscasca commented 1 year ago

The Field property is only used by the EditForm to enable field validation and other form specific tricks. The data binding using bind-Value is to facilitate the use of the variable containing the editor value. As such you can use data binding outside of a form for other purposes but inside of a form you need to specify the Field property.