'attributes' is null

2 posts, 0 answers
  1. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 21 Feb 2011 Link to this post

    When attempting to add a simple unordered list template to a RadComboBox with EnableLoadOnDemaned=true, I get this javascript error: 'attributes' is null or not an object.

        <li><%# Container.Text %></li>

    Also tried accessing the DataItem property directly with the exact same result:

        <li><%# DataBinder.Eval(Container.DataItem, "Name") %></li>
  2. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 24 Feb 2011 Link to this post

    Hi Msigman,

    The reason your are getting this error is because with the following declaration provided you are messing the combobox item rendering. The first problem is that header template and footer templates are placed in different divs then the items of the combobox. Thus putting ul open tag in the header is absolutely useless since the browser is automatically adding the closing tag. On other hand it is ignoring the closing </ul> tag  in the footer template and it;s empty. The error occurs since the text of each item is enclosed in <li></li> tags and as you add another set of <li></li> tags  is causing a confusion for the browser and this is how the error is reproduced. If you still want to have a list looking template for the combobox  items , you have to add both ul and li tags for each item:
                 <%# DataBinder.Eval(Container,"Text") %>

    Best wishes,
    Dimitar Terziev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top