'null' is null or not and object

4 posts, 0 answers
  1. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 14 Feb 2008 Link to this post

    Hi

    In RadScheduler, when you put in appointmentTemplate an ImageButton to do the exportCalendar event, when I do a postBack, it's appear "'null' is null or not and object" javaScript Error, but when I use a button instead of the imageButton, this error doesn't appear.

    In my application I used AjaxUpdatePanels, RadLoadingPanels, RadCalendar, RadComboBox, RadTreeview, ...

    Why this error appears when I use a imageButton and not when I use a button?

    Thanks for all.

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 15 Feb 2008 Link to this post

    Hello,

    The iCalendar Export example uses an image button and it works as expected. What is different in your implementation? Could you please send us some code which could help us recreate the problem?



    Greetings,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Thencho
    Thencho avatar
    18 posts
    Member since:
    Mar 2007

    Posted 15 Feb 2008 Link to this post

    Hi

    This is the ASPX code
    <head id="Head1" runat="server">  
      <script type="text/javascript">  
            function stopPropagation(e)  
            {  
                e.cancelBubble = true;  
                if (e.stopPropagation)  
                {  
                    e.stopPropagation();  
                }  
            }  
            function ChekearTodo(idRad,idChk,cb,bool)  
            {  
                var i;  
                if(cb==idRad+'_i0_'+idChk)  
                {     
                    var elem = document.form1.elements;  
                    for(i=0;i<elem.length;i++)  
                    {  
                         if(elem[i].id.indexOf(idRad)==0)  
                         {  
                            elem[i].checked=bool;  
                         }  
                    }  
                }  
            }  
            </script> 
          <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
     
            <script type="text/javascript">  
                function Export(sender, e)  
                {  
                    $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, "");  
                }  
            </script> 
     
        </telerik:RadCodeBlock> 
    </head> 
    <body id="Body1" class="fondoModulo" runat="server" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">  
    <script type="text/javascript">  
                function Export(sender, e)  
                {  
                    $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, "");  
                }  
            </script> 
        <form id="form1" runat="server">  
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
            </asp:ScriptManager> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="calendario">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="calendario" /> 
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="RadScheduler1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="calendario" /> 
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="btnActualizar">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" 
                Width="75px" HorizontalAlign="Center" InitialDelayTime="500"   
                Transparency="30" BackColor="#E0E0E0">  
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/indicator_azul.gif" Style="margin-top: 300px"/>  
            </telerik:RadAjaxLoadingPanel> 
              
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
                <ContentTemplate> 
                    <table align="center" border="0" cellpadding="0" cellspacing="0" height="20px">  
                        <tr id="trMensajes" runat="server">  
                            <td id="Td1" runat="server" align="center" height="20px" style="">  
                                <asp:Label ID="lblError" runat="server" CssClass="textoError" meta:resourcekey="lblErrorResource1"></asp:Label><asp:Label  
                                    ID="lblSelecc" runat="server" CssClass="textoAviso" meta:resourcekey="lblSeleccResource1"></asp:Label> 
                            </td> 
                        </tr> 
                    </table> 
                </ContentTemplate> 
                <Triggers> 
                    <asp:AsyncPostBackTrigger ControlID="btnActualizar" EventName="Click" /> 
                </Triggers> 
            </asp:UpdatePanel> 
            <div> 
                <%--<telerik:RadAjaxPanel ID="radAjaxPanelParams" runat="server">--%> 
                <asp:Panel ID="pnlParams" runat="server">  
                    <table align="center" width="100%">  
                        <tr> 
                            <td align="right">  
                                <asp:Label ID="lblCliente" Text="Clientes: " runat="server" CssClass="etiqueta"></asp:Label> 
                            </td> 
                            <td> 
                               <telerik:RadComboBox ID="cboClientes" runat="server"   
                                    HighlightTemplatedItems="true" Sort="Ascending" Height="200px"   
                                    Skin="Vista" Width="320px" EnableLoadOnDemand="True">  
                                   <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                   <ExpandAnimation Type="OutQuart" /> 
                        <ItemTemplate> 
                            <table style="text-align: left">  
                                <tr> 
                                    <td onclick="stopPropagation(event);">  
                                   <asp:CheckBox ID="CheckBox1" runat="server" Text=""/>  
                                    </td> 
                                    <td align="left" onclick="stopPropagation(event);" width="100px">  
                                        <%#DataBinder.Eval(Container.DataItem, "Codigo")%> 
                                    </td> 
                                    <td align="left" onclick="stopPropagation(event);" width="10px">  
                                        -</td> 
                                    <td align="left" onclick="stopPropagation(event);" width="200px">  
                                        <%#DataBinder.Eval(Container.DataItem, "Denominacion")%> 
                                    </td> 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
                    </telerik:RadComboBox> 
                            </td> 
                            <td align="right">  
                                <asp:Label ID="lblTipos" Text="Tipos de Proyecto: " runat="server" CssClass="etiqueta"></asp:Label> 
                            </td> 
                            <td> 
                           <telerik:RadComboBox ID="cboTipos" runat="server" HighlightTemplatedItems="true"   
                                    Sort="Ascending" Height="200" Skin="Vista" Width="320px"   
                                    EnableLoadOnDemand="True">  
                               <CollapseAnimation Duration="200" Type="OutQuint" /> 
                               <ExpandAnimation Type="OutQuart" /> 
                        <ItemTemplate> 
                            <table style="text-align: left">  
                                <tr> 
                                    <td onclick="stopPropagation(event);">  
                                   <asp:CheckBox ID="CheckBox1" runat="server" Text=""/>  
                                    </td> 
                                    <td align="left" onclick="stopPropagation(event);" width="100px">  
                                        <%#DataBinder.Eval(Container.DataItem, "Codigo")%> 
                                    </td> 
                                    <td align="left" onclick="stopPropagation(event);" width="10px">  
                                        -</td> 
                                    <td align="left" onclick="stopPropagation(event);" width="200px">  
                                        <%#DataBinder.Eval(Container.DataItem, "Denominacion")%> 
                                    </td> 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
                    </telerik:RadComboBox> 
                            </td> 
                            <td align="right">  
                                <asp:Label ID="lblProyectos" runat="server" CssClass="etiqueta"   
                                    Text="Proyectos: "></asp:Label> 
                            </td> 
                            <td> 
                                <telerik:RadComboBox ID="cboProyectos" runat="server" HighlightTemplatedItems="true"   
                                    Sort="Ascending" Height="200" Skin="Vista" Width="200px"   
                                    EnableLoadOnDemand="True">  
                               <CollapseAnimation Duration="200" Type="OutQuint" /> 
                               <ExpandAnimation Type="OutQuart" /> 
                        <ItemTemplate> 
                            <table style="text-align: left">  
                                <tr> 
                                    <td onclick="stopPropagation(event);">  
                                   <asp:CheckBox ID="CheckBox1" runat="server" Text=""/>  
                                    </td> 
                                    <td align="left" onclick="stopPropagation(event);">  
                                        <%#DataBinder.Eval(Container.DataItem, "Denominacion")%> 
                                    </td> 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
                    </telerik:RadComboBox></td>  
                            <td> 
                                <asp:ImageButton ID="btnActualizar" runat="server" /> 
                            </td> 
                        </tr> 
                    </table>     
                    </asp:Panel> 
                 <%--   </telerik:RadAjaxPanel>--%> 
                    </div> 
           <div style="float: left">  
                <div style="vertical-align: top">  
                 <%--<telerik:RadAjaxPanel ID="radAjaxPanel2" runat="server">--%> 
                    <asp:Panel ID="pnlCalendario" runat="server">  
                        <table> 
                        <tr> 
                            <td> 
                         <asp:ImageButton runat="server" ID="btnExport" ImageUrl="~/Images/exportButton.gif" AlternateText="Exportar todo a Outlook"/>  
                         <%--OnClientClick="Export(this, event); return false;"--%> 
                            </td> 
                        </tr> 
                            <tr> 
                                <td width="100%" align="center" background="Images/rsHeaderBg.gif">  
                                    <asp:Label ID="lblVistas" runat="server" CssClass="textoTituloModulo" 
                                        Text=".: Calendario :." Width="100%"></asp:Label> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    <telerik:RadCalendar runat="server" ID="calendario" Skin="Vista" AutoPostBack="true" 
                                        EnableMultiSelect="false" DayNameFormat="Shortest" UseRowHeadersAsSelectors="true">  
                                    </telerik:RadCalendar> 
                                </td> 
                            </tr> 
                        </table> 
                    </asp:Panel> 
                   <%-- </telerik:RadAjaxPanel>--%> 
                </div> 
               <div style="vertical-align: bottom">  
                   <br /> 
                   <asp:UpdatePanel ID="UpdatePanel2" runat="server">  
                   <ContentTemplate> 
                   <asp:Label ID="lblTitRec" runat="server" Text="Recurso Actual: " CssClass="etiqueta"></asp:Label> 
                   <asp:Label ID="lblRecurso" runat="server" CssClass="etiquetaValue"></asp:Label> 
                   <telerik:RadTreeView ID="radTreeEquipos" runat="server" Skin="Office2007" CheckBoxes="True" 
                       LoadingMessage="Cargando ..." MultipleSelect="True"   
                       LoadingStatusPosition="BeforeNodeText">  
                       <CollapseAnimation Type="OutQuint" Duration="100"></CollapseAnimation> 
                       <ExpandAnimation Type="OutQuart" Duration="100"></ExpandAnimation> 
                       <NodeTemplate> 
                       <asp:Label ID="lblNodo" runat="server" CssClass="textoGeneral"></asp:Label>&nbsp;<asp:Label ID="lblEstilo" runat="server" text=" " Width="10px" Height="10px"></asp:Label> 
                       </NodeTemplate> 
                   </telerik:RadTreeView> 
                   </ContentTemplate> 
                     <%--  <Triggers> 
                           <asp:AsyncPostBackTrigger ControlID="btnActualizar" EventName="Click" /> 
                       </Triggers>--%> 
                   </asp:UpdatePanel> 
               </div> 
            </div> 
            <div> 
                <telerik:RadScheduler ID="RadScheduler1" runat="server" AllowDelete="False" AllowEdit="False" 
                            AllowInsert="False" Culture="Spanish (Spain)"   
                    DayEndTime="20:00:00" FirstDayOfWeek="Monday" 
                            Height="600px" LastDayOfWeek="Sunday" ReadOnly="True" SelectedView="WeekView" 
                            Skin="Vista" WorkDayEndTime="19:00:00" WorkDayStartTime="09:00:00"   
                    OverflowBehavior="Scroll">  
                            <ResourceTypes> 
                                <telerik:resourcetype name="Recursos" ForeignKeyField="Recurso" KeyField="MAQUI" TextField="Denomi"></telerik:resourcetype> 
                            </ResourceTypes> 
                            <Localization AdvancedAllDayEvent="Eventos Diarios" AdvancedCalendarCancel="Cancelar" 
                                AdvancedCalendarToday="Hoy" AdvancedDay="Dia" AdvancedDays="Dias" AdvancedDescription="Descripci&#243;n:" 
                                HeaderDay="Dia" HeaderMonth="Mes" HeaderNextDay="Siguiente Dia" HeaderPrevDay="Dia Anterior" 
                                HeaderToday="Hoy" HeaderWeek="Semana" Show24Hours="Mostrar 24 horas" ShowAdvancedForm="M&#225;s" 
                                ShowBusinessHours="Mostrar Horas de trabajo" ShowMore="Mostrar Mas"   
                                AdvancedDaily="Diario" AdvancedEvery="Todos" AllDay="Todo el Día"   
                                Cancel="Cancelar" ConfirmCancel="Cancelar" Insert="Insertar"   
                                Update="Modificar" /> 
                    <AppointmentTemplate> 
                    <%# Eval("Subject") %> 
                    <br /> 
                    <asp:Label runat="server" ID="lblProyecto" /> 
                    <br /> 
                    <asp:Label runat="server" ID="lblRecurso" /> 
                    <div style="text-align:right">  
                      
                      
                                      <asp:ImageButton runat="server" ID="imgButton1" ImageUrl="~/Images/Outlook.gif" AlternateText="Exportar a Outlook" 
                                            CommandName="Export" OnClientClick="Export(this, event); return false;"/>
     
                                </div> 
                    </AppointmentTemplate> 
                    </telerik:RadScheduler> 
            </div> 
        </div> 
        </form> 
    </body> 
    </html> 

    The first time that you see, it´s go well, but when you do click in btnActualizar and do a postback, if you put the mouse in an appointment show the error.

    Thanks for all.
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 19 Feb 2008 Link to this post

    Hi,

    We created a test project using the code you sent us, but still the problem didn't appear on our side. Can you open a support ticket and send us a small sample project demonstration the issue?

    Kind regards,
    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top