[CLOSED] [1.2] DateFields in daterange

  1. #1

    [CLOSED] [1.2] DateFields in daterange

    Hi,

    I'm using 2 datefield nested with "Vtype="daterange"", but, when I clean one or both values, it keeps last range selection.
    What is wrong?

    Example:

    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager ID="rsm" runat="server">
            </ext:ResourceManager>
            <ext:DateField ID="FechaInicio_DateField" FieldLabel="F.Inicio" runat="server" AllowBlank="false" Width="200"
                EnableKeyEvents="true" Vtype="daterange">
                <CustomConfig>
                    <ext:ConfigItem Name="endDateField" Value="#{FechaFin_DateField}" Mode="Value" />
                </CustomConfig>
                <Plugins>
                    <ux:InputTextMask Mask="99/99/9999">
                    </ux:InputTextMask>
                </Plugins>
            </ext:DateField>
            <ext:DateField ID="FechaFin_DateField" FieldLabel="F.Fin" runat="server" AllowBlank="false" Width="200"
                EnableKeyEvents="true" Vtype="daterange">
                <CustomConfig>
                    <ext:ConfigItem Name="startDateField" Value="#{FechaInicio_DateField}" Mode="Value" />
                </CustomConfig>
                <Plugins>
                    <ux:InputTextMask Mask="99/99/9999">
                    </ux:InputTextMask>
                </Plugins>
            </ext:DateField>
            <ext:Button ID="Btn" runat="server" Text="Click">
                <DirectEvents>
                    <Click OnEvent="Click">
                    </Click>
                </DirectEvents>
            </ext:Button>
        </div>
        </form>
    </body>

    Functions that I used to "clean"
    
        Sub Click()
    
            FechaInicio_DateField.SetValue("")
            FechaFin_DateField.SetValue("")
            FechaInicio_DateField.Reset()
            FechaFin_DateField.Reset()
            FechaInicio_DateField.SelectedDate = Nothing
            FechaFin_DateField.SelectedDate = Nothing
    
        End Sub
    Last edited by Daniil; Jun 05, 2012 at 4:05 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Min and max values should be manually cleared as well.

    Example
    protected void Clear(object sender, DirectEventArgs e)
    {
        this.DateField1.Reset();
        this.DateField2.Reset();
        this.DateField1.Call("setMaxValue", null);
        this.DateField2.Call("setMinValue", null);
    }
  3. #3
    Yes, it works.

    Also with
    this.DateField1.setValue("");

Similar Threads

  1. [CLOSED] V2.0 DateFields with DateRange
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 16, 2012, 4:17 PM
  2. [CLOSED] Different time zone settings on DateFields
    By georgek in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 04, 2010, 1:40 AM
  3. [CLOSED] Using DateFields-Values as BaseParams in Code-Behind
    By macap in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 14, 2009, 12:04 PM
  4. Replies: 2
    Last Post: Mar 30, 2009, 8:29 AM
  5. DateFields adds one month
    By EzaBlade in forum 1.x Help
    Replies: 1
    Last Post: Mar 23, 2009, 1:09 PM

Posting Permissions