How to get the textarea for Longstring in the old editor UI

Vote:
 

The new

[UIHint(UIHint.Textarea)]

is working fine in the new UI.

But if (for some reason) the editor wants to edit that property in the old UI? Well the textarea is gone, there is only a textbox input now.

How to fix this?

#63109
Nov 09, 2012 11:10
Vote:
 

Hi

I think you need to specify backing type for the legacy UI, as it doesn't undestand the UI hint setting.

In this case you would add [BackingType(typeof(PropertyLongString))] to your model.

Regards

Per Gunsarfs

#63116
Nov 09, 2012 13:08
Vote:
 

Nope, have already tried that, nothing happens :-(

#63128
Nov 09, 2012 14:05
Vote:
 

I looked into this and PropertyLongString is the default backing type for strings to be able to store strings of any length. With this change came that PropertyLongString creates a "normal" string editor by default. If you want to edit your typed model long strings in legacy mode there is a simple work around. Create a custom property that inherits from PropertyLongString and always return an instance of PropertyLongStringControl:

    [ContentType(GUID = "F8D47655-7B50-4319-8646-3369BA9AF05E")]
    public class MyPage : SitePageData
    {
        [UIHint(UIHint.Textarea)]
        [BackingType(typeof(LegacyLongString))]
        public virtual string LongString { get; set; }
    }

    [PropertyDefinitionTypePlugIn]
    public class LegacyLongString : PropertyLongString
    {
        public override IPropertyControl CreatePropertyControl()
        {
            return new PropertyLongStringControl();
        }
    }

    

#63171
Nov 12, 2012 15:28
Vote:
 

Thanks for the workaround!

/Fredrik

#63178
Nov 13, 2012 9:35
Vote:
 

Hi Linus,

CreatePropertyControl() doesn't work in EpiServer7.5. 

I had created one custom property in EpiServer6R2 to display horizontal ine in Edit mode (for sepration of header and footer properties) but this property doesn't work in 7.5. it doesn't call CreatePropertyControl() while debugging. Do you have any ideas why it is not calling?

Thanks in advance.

#111659
Oct 17, 2014 10:12
Vote:
 

Thanks Linus!

#171314
Nov 07, 2016 13:46
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.