[CLOSED] Datepickerfield error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Datepickerfield error

    Hi I am having a problem with the Datepickerfield control.

    If i place one on my page i am getting an error as follows...
    System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Ext.Net.Mobile.DatePickerFieldBase.set_RawValue(Ob ject value) at Ext.Net.Mobile.DatePickerFieldBase.LoadPostData(St ring postDataKey, NameValueCollection postCollection) at Ext.Net.Mobile.Field.System.Web.UI.IPostBackDataHa ndler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollec tion postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.admin_mobile_flexmobile_aspx.ProcessRequest(Ht tpContext context) at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)


    I am not even trying to set a date on it.
    It happens on page load and every subsequent direct event triggers the same error.
    If i put it on a blank page it seems ok so it must be clashing with something on my page.

    I have tried removing numerous things from page without success.
    My page is too big to post so just wondering if you know anything about this error.

    Also on the empty page where it does load if i try to set a date on it from page load it throws an error also saying object can't be found.

    Thanks
    Last edited by fabricio.murta; Dec 01, 2017 at 5:16 PM. Reason: no feedback from the user in 7+ days
  2. #2
    Hello @Fergus!

    We don't know about this issue, as we have an example that uses the date field without issues here: http://mobile.ext.net/#demo/formpanel

    There should indeed be some library competing with Ext.NET Mobile and breaking the component.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    As you can see from this example when you click on the button it throws an error.

    Even though the direct event is empty.
    Even if i set visible=false for the datepickerfield it is still the same.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestGridPanel.aspx.vb" Inherits="Admin_Mobile_TestGridPanel" %>
    
    <%@ Register Assembly="Ext.Net.Mobile" Namespace="Ext.Net.Mobile" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" AjaxTimeout="60000" ScriptMode="Debug" InitScriptMode="Linked"></ext:ResourceManager>
            <ext:Viewport runat="server">
                <Items>
                    <ext:Toolbar runat="server" Docked="Top">
                        <Items>
                            <ext:Button runat="server" Text="Update" ID="btn1">
                                <DirectEvents>
                                    <Tap OnEvent="ListUsers">
                                        <EventMask ShowMask="true"></EventMask>
                                    </Tap>
                                </DirectEvents>
                            </ext:Button>
                            <ext:DatePickerField
                                runat="server" DateFormat="d"
                                DestroyPickerOnHide="true"
                                Name="date"
                                Label="Start Date">
                                <Picker runat="server" YearFrom="1990" DateValue="2016-06-24" />
                            </ext:DatePickerField>
                            
                        </Items>
                    </ext:Toolbar>
    
    
                </Items>
            </ext:Viewport>
    
        </form>
    </body>
    </html>
    Partial Class Admin_Mobile_TestGridPanel
        Inherits System.Web.UI.Page
    
        Private Sub Admin_Mobile_TestGridPanel_Load(sender As Object, e As EventArgs) Handles Me.Load
            listUsers(Nothing, Nothing)
    
            'dpf1.SetValue(Date.Now)
            btn1.SetText("hello")
        End Sub
    
        Protected Sub listUsers(sender As Object, e As DirectEventArgs)
    
        End Sub
    
    
    End Class
  4. #4
    Hello, @Fergus!

    Your code has an error where you bind the Tap event. You are using ListUsers where you defined an listUsers method. Notice the lowercase.

    When I fixed that error I could load the page and click the button, no error happens at all on my side.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hi,
    Thanks for pointing that out. But still the same error here.

    I have changed both references to ListUsers.

    I am using Latest version of chrome with the downloaded ext.net 4.4 dlls.

    Click image for larger version. 

Name:	ExtNetDatepickerField.JPG 
Views:	120 
Size:	42.1 KB 
ID:	25043

    When i click on the button the error happens and also the text in the datepicker at the bottom becomes smaller.

    Strange you are not getting same error.

    I attach new code with an alert statement. If you expand the datepicker field first then click the button.

    Tried testing in Firefox but neither button or datefield react to click.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestGridPanel.aspx.vb" Inherits="Admin_Mobile_TestGridPanel" %>
    
    <%@ Register Assembly="Ext.Net.Mobile" Namespace="Ext.Net.Mobile" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager runat="server" AjaxTimeout="60000"></ext:ResourceManager>
            <ext:Viewport runat="server">
                <Items>
                    <ext:Toolbar runat="server" Docked="Top">
                        <Items>
                            <ext:Button runat="server" Text="Update" ID="btn1">
                                <DirectEvents>
                                    <Tap OnEvent="ListUsers">
                                        <EventMask ShowMask="true"></EventMask>
                                    </Tap>
                                </DirectEvents>
                            </ext:Button>
                            <ext:DatePickerField runat="server" >
    <%--                            <Picker runat="server" YearFrom="1990" DateValue="2016-06-24" />--%>
                            </ext:DatePickerField>
                            
                        </Items>
                    </ext:Toolbar>
    
    
                </Items>
            </ext:Viewport>
    
        </form>
    </body>
    </html>
    Imports Ext.Net.Mobile
    
    Partial Class Admin_Mobile_TestGridPanel
        Inherits System.Web.UI.Page
    
        Private Sub Admin_Mobile_TestGridPanel_Load(sender As Object, e As EventArgs) Handles Me.Load
            'listUsers(Nothing, Nothing)
    
            'dpf1.SetValue(Date.Now)
            btn1.SetText("hello")
        End Sub
    
        Protected Sub ListUsers(sender As Object, e As DirectEventArgs)
            Ext.Net.Mobile.X.Msg.Alert("", "test").Show()
    
        End Sub
    Thanks
  6. #6
    If you do not see the error i wonder if this has something to do with me using a touch screen laptop.
    I remember it causing other problems before.

Similar Threads

  1. Replies: 2
    Last Post: Mar 24, 2017, 1:45 AM
  2. [CLOSED] DatePickerField - Date format
    By sveins12 in forum Mobile Help
    Replies: 5
    Last Post: Feb 27, 2017, 7:36 AM
  3. [CLOSED] DatePickerField - Javascript error
    By sveins12 in forum Mobile Help
    Replies: 4
    Last Post: Feb 02, 2017, 10:48 PM
  4. Replies: 4
    Last Post: Nov 04, 2016, 3:17 AM
  5. Replies: 2
    Last Post: Jul 29, 2009, 1:57 PM

Tags for this Thread

Posting Permissions