Interface Widget for Custom Data

Posted by Community Admin on 03-Aug-2018 21:50

Interface Widget for Custom Data

All Replies

Posted by Community Admin on 17-Mar-2011 00:00

I was trying to get the Custom Interface widget when creating a custom field to work.  I followed the steps on this post:

www.sitefinity.com/.../using-a-custom-interface-widget-when-creating-a-custom-field.aspx

but am still getting an "Exception has been thrown by the target of an invocation." when trying to save the new metafield.  I think the error may lie where I put the nulls but I am not sure what values are supposed to go in there.  Is there a working example that I could use otherwise?

using System;
using Telerik.Sitefinity.Web.UI.Fields;
using Telerik.Sitefinity.Web.UI;
 
namespace Telerik.Sitefinity.Samples
    [FieldDefinitionElement(typeof(GenericCustomFieldEditorDefinitionElement))]
 
     
    class AssociatedImage : CompositeFieldControl
    
        protected override System.Web.UI.WebControls.WebControl TitleControl
        
            get throw new NotImplementedException();
        
   
        protected override System.Web.UI.WebControls.WebControl DescriptionControl
        
            get throw new NotImplementedException();
        
   
        protected override System.Web.UI.WebControls.WebControl ExampleControl
        
            get throw new NotImplementedException();
        
   
        protected override void InitializeControls(Web.UI.GenericContainer container)
        
            throw new NotImplementedException();
        
   
        protected override string LayoutTemplateName
        
            get throw new NotImplementedException();
        
     
    
 


public class GenericCustomFieldEditorDefinitionElement : Telerik.Sitefinity.Web.UI.Fields.Config.FieldControlDefinitionElement, Telerik.Sitefinity.Web.UI.Fields.Contracts.ITextFieldDefinition
    public GenericCustomFieldEditorDefinitionElement(Telerik.Sitefinity.Configuration.ConfigElement parent) : base(null)
 
    public override DefinitionBase GetDefinition()
    
        return null;
    
 
    public int Rows
    
        get throw new NotImplementedException();
        set Rows = value;
    
    public string HideIfValue
    
        get throw new NotImplementedException();
        set HideIfValue = value;
    
 
    public Telerik.Sitefinity.Web.UI.Extenders.Contracts.IExpandableControlDefinition ExpandableDefinition
    
        get throw new NotImplementedException();
    
 

Thanks,

Josh

Posted by Community Admin on 18-Mar-2011 00:00

Hi ,

Can you provide the stack trace of the error? Also in your classes the methods are not implemented at all.

Greetings,
Ivan Dimitrov
the Telerik team

Posted by Community Admin on 21-Mar-2011 00:00

Hi Ivan,

Thank you for your response.  I was actually able to find out how to create custom metafields from this post:

http://www.sitefinity.com/blogs/slavoingilizov/posts/11-02-11/creating_a_thumbnail_selector_for_news_items.aspx


Kind Regards,

Josh

This thread is closed