Try our conversational search powered by Generative AI!

Using FullRefreshPropertiesMetaData with a TextArea property

Vote:
 

I have an issue where I have a string property with UIHint.Textarea added to it so that I can put multiline text into the field. The controller/view takes what is entered into that field and does some server side tranformation of it and spits out a structure the view uses to populate the page. So in order for me to enable on-page editing I have added the edit attributes so that it shows a popup of the textarea editor for it, but I need a full-page refresh before the results of editing that field can be shown. Inline replacement of the markup wont work in this case due to the server side code that transforms it. So I added the field to the FullRefreshPropertiesMetaData method call, but this refresh is triggered on every key stroke, rather than when the edit dialog is closed. Does anyone know a way to delay the refresh until the dialog is closed, or maybe some other methodology of on page editing that would work in this case? It feels like my only option is to exclude this field from on page editing.

#206518
Aug 22, 2019 19:45
Vote:
 

Hi Jason,

Can you please post some code samples here?

#206618
Aug 27, 2019 8:27
Vote:
 

Here is the definition of a textarea property we wanted to enable editing on the page:

[Display(
   GroupName = SystemTabNames.Content,
   Name = "Sold-Out Communities List",
   Order = 60)]
[UIHint(UIHint.Textarea)]
public virtual string SoldOutCommunities { get; set; }

The controller takes this input and reformats it to be displayed to the user, so its not just plain text spit back out onto the page. Due to this, I have to force a refresh for the user to see their changes using this method:

@Html.FullRefreshPropertiesMetaData(new [] { "SoldOutCommunities" })

To enable on-page editing we applied the @Html.EditAttributes to the container element so it would show the editor. We added data-epi-property-edittype="floating" so that is shows as a popup rather than inline. The side effect is that the page refreshes every character to type. Its totally unusable. It makes me wish there were client side attributes to control when the page refreshes based on the change of a property.

#206644
Aug 27, 2019 15:31
JJ
Vote:
 

Did you ever manage to find a solution to this problem? We have this issue for UIHint.Textarea properties that the page gets refreshed on every keypress. This causes sometimes data not to be posted correctly.

#252946
Apr 09, 2021 18:55
Vote:
 

I was typing out a long answer on this, but then I decided to just throw together an article about an approach I have used along with code samples.

The approach I took is to create an EditorDescriptor and a very simple custom Dojo Dijit to use the same method the PreviewableText UIHint does, but with a TextArea. 

Check it out here: https://beendaved.blogspot.com/2021/04/previewable-textarea-properties.html

Let me know if this helps, or if you have any questions.

#253087
Apr 12, 2021 22:34
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.