Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to apply multiple UIHint to a property editor

Vote:
 

Hi,

I am trying to apply a css class to the default property editor for the ContentReference type

But it only apply my UIHint and not apply default  [UIHint(EPiServer.Commerce.UIHint.CatalogContent)]

How can apply both of them?

My code

namespace NTC.Models.Commerce.V2.EditorDescriptor
{
[EditorDescriptorRegistration(
TargetType = typeof(ContentReference),
UIHint = SiteUIHints.ReloadPage)]
public class EmbiggenEditorDescriptor : EPiServer.Shell.ObjectEditing.EditorDescriptors.EditorDescriptor
{
    public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<System.Attribute> attributes)
    {
       base.ModifyMetadata(metadata, attributes);
       metadata.EditorConfiguration.Add("class", "epi__catalog-node--reload");
    }
}
}

[CultureSpecific]
[AllowedTypes(typeof(NTCCategory))]
[UIHint(SiteUIHints.ReloadPage)] // Only apply this UIHint
[UIHint(EPiServer.Commerce.UIHint.CatalogContent)] // Can't apply this UIHint
public virtual ContentReference CategoryNode { get; set; }

Thanks,

Thao Pham

#204409
Edited, May 31, 2019 11:03
Vote:
 

You just can't. However you can define your CatalogContentReferenceEditorDescriptor and register it with EditorDescriptorBehavior.OverrideDefault

#204413
May 31, 2019 11:19
Vote:
 

Hi Quan,

By the way, i have another quesion

I have a custom property, this property fetch data from the property call CategoryNode that i defined above,

But when i change category node i have to reload page in order to my custom property fetch new data from new node

This oparation is not good for user experences, so is the any way to refresh data from my custom property each time i select a new node?

My code

[CultureSpecific]
[AllowedTypes(typeof(NTCCategory))]
[UIHint(SiteUIHints.ReloadPage)] // Only apply this UIHint
[UIHint(EPiServer.Commerce.UIHint.CatalogContent)] // Can't apply this UIHint
public virtual ContentReference CategoryNode { get; set; }

[CultureSpecific]
[ClientEditor(SelectionFactoryType = typeof(TechspecsSelectionFactory))]
[UIHint(GlobalValues.UIHints.IListDefault)]
public virtual IList<string> TechspecsAttributes { get; set; }

Thanks,

Thao Pham

#204414
May 31, 2019 11:32
Vote:
 

I suppose you might have your widget for TechspecsAttributes to listen to change in the other widget.  Or, combine those widgets into one. I don't know, I haven't tried that, and Dojo is not my area of expertise, but I think it's doable. 

#204415
May 31, 2019 11:36
Vote:
 

Hi Quan,

I don't combine those wigets into one. TechspecsAttributes to listen to change in the other widget

Thanks,

Thao Pham

#204416
May 31, 2019 11:47
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.