1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / ContentSelector throws System.NullReferenceException

ContentSelector throws System.NullReferenceException

12 posts, 0 answered
  1. Tobias
    Tobias avatar
    11 posts
    Registered:
    02 Mar 2009
    15 Apr 2009
    Link to this post
    Hello,

    i trying to implement a generic content selector.
    I did it the way, Ivan posted it on his blog

    But everytime i try to select a content i get a System.NullReferenceException.

        private Guid _SelectedContent = null
        [WebEditor("Telerik.Cms.Engine.WebControls.ContentSelector, Telerik.Cms.Engine")] 
        public Guid SelectedContent 
        { 
            get 
            { 
                return _SelectedContent; 
            } 
            set 
            { 
                _SelectedContent = value; 
            } 
        } 

    Whats wrong?

    The next question: Is it possible to select more than one content? So that the SelectedContent property is a Guid-Array or a List<Guid>.

    Thanks,
    Tobias
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 Apr 2009
    Link to this post
    Hi Tobias,

    We found a bug that has been caused due to new architecture in Sitefinity 3.6. We will try to come up with a solution for the upcoming SP. The selector provides option for selecting only one content item.

    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Tobias
    Tobias avatar
    11 posts
    Registered:
    02 Mar 2009
    16 Apr 2009
    Link to this post
    Hello Ivan,

    thanks for your answer.
    Can you indicate when you will be releasing the SP for 3.6

    Thanks,
    Tobias
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    16 Apr 2009
    Link to this post
    Hello Tobias,

    We are started testing and we are fixing some bugs that we came across, so I believe that in a day or two we will be able to release.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Tobias
    Tobias avatar
    11 posts
    Registered:
    02 Mar 2009
    26 Apr 2009
    Link to this post
    Hello Ivan,

    i updated to Sitefinity 3.6 SP1. Unfortunately the problem still exists.
    The error is the same: NullReferenceException.

    Is there a workaround?

    Greetings,
    Tobias
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    26 Apr 2009
    Link to this post
    Hi Tobias,

    You should not get "Null reference exception" if you have upgraded to SP1. We fixed this issue, but it seems that there is another problem with selecting the content after you open the selector. Unfortunately, there is no workaround for the second problem we found.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Tobias
    Tobias avatar
    11 posts
    Registered:
    02 Mar 2009
    27 Apr 2009
    Link to this post
    Hello Ivan,

    that are bad news.
    BTW: here is the call stack of the NullReferenceException:
    [NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.] 
       Telerik.Cms.Web.UI.PropertyEditorDialog.GetEditor() +785 
       Telerik.Cms.Web.UI.PropertyEditorDialog.CreateChildControls() +231 
       System.Web.UI.Control.EnsureChildControls() +87 
       System.Web.UI.Control.PreRenderRecursiveInternal() +44 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Control.PreRenderRecursiveInternal() +171 
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842 
     

    Can you provide a  patch or hotfix to fix this problem?

    Greetings,
    Tobias
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    27 Apr 2009
    Link to this post
    Hello Tobias,

    You could get null reference if you have not specified the provider property or you use 3.6, 3.6 hotfix. In 3.6 SP1 selecting the content throws error, which means you cannot use this selector properly. The problem is due to one of the properties and adding of a container. We will fix the problem for the next release( we will have a SP2 ).

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Tobias
    Tobias avatar
    11 posts
    Registered:
    02 Mar 2009
    27 Apr 2009
    Link to this post
    Hello Ivan,

    how i specify the provider property?

    I downloaded the 3.6 SP1 Patch for Standard Version (file name: Sitefinity_3_6_1920_standard_patch).

    Can you indicate when you will be releasing the SP2.

    Greetings,
    Tobias
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    27 Apr 2009
    Link to this post
    Hi Tobias,

    Check out the code below:

        [WebEditor("Telerik.Cms.Engine.WebControls.ContentSelector, Telerik.Cms.Engine")] 
     
        public Guid SelectContent 
     
        { 
     
            get 
     
            { 
     
                return this.selectContent; 
     
            } 
     
            set 
     
            { 
     
                this.selectContent = value; 
     
            } 
     
        } 
     
        //declare Provider Name property 
     
        public virtual string ProviderName 
     
        { 
     
            get 
     
            { 
     
                return this.providerName; 
     
            } 
     
            set 
     
            { 
     
                this.providerName = value; 
     
            } 
     
        } 
     
        private Guid selectContent; 
     
        private string providerName = string.Empty; 
     

    The have plans to release the service pack after Q2 2009, because we will release a build with Q2 controls.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Tobias
    Tobias avatar
    6 posts
    Registered:
    04 Feb 2009
    27 Apr 2009
    Link to this post
    Hello Ivan,

    thanks for the code. That did the trick.
    Now i can select a generic content, there is no error as you mentioned it. Works like a charm, currently!

    Thanks for your help and your patience.
    Greetings,
    Tobias
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    27 Apr 2009
    Link to this post
    Hi Tobias,

    Let us know if there is anything else that we can do for you.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
12 posts, 0 answered