[CLOSED] when dateField.Text property is empty contains different values

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] when dateField.Text property is empty contains different values

    Hi,

    when dateField.Text property is empty, it contains different values if I change the language of the browser.
    I need that the dateField contains always the same value because my application displays the error if I change the browser language.

    I tried on firefox and Chrome.

    How can set the dateField for to do it?

    Thanks in advance.
    Regards.
    Last edited by Daniil; Apr 16, 2013 at 4:48 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Can you provide test case and steps to reproduce: http://forums.ext.net/showthread.php?10205
  3. #3
    Hi,

    I have two dateField that I use in my application as DateRange. In "dateFieldStartDate"
    is mandatory specify the value instead the "dateFieldEndDate" is free.
    In the example below, when I click on the search button and the "dateFieldEndDate" is empty I can see in the messagebox that "dateFieldEndDate" displays different value if I run the page with different browser language.

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Xml" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
        protected void SearchLeadtime(object sender, DirectEventArgs e)
        {
           X.Msg.Alert("Status", " dateFieldStartDate: "+ dateFieldStartDate + " - dateFieldEndDate : " + dateFieldEndDate.Text).Show();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Examples</title>
    
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Flex="1" Layout="HBoxLayout" Border="false" AutoHeight="true" Header="false">
                <Defaults>
                    <ext:Parameter Name="margins" Value="5 5 0 5" Mode="Value" />
                </Defaults>
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Padding="3" Align="Middle" />
                </LayoutConfig>
        		<Items>
    				<ext:DateField ID="dateFieldStartDate" runat="server" Vtype="daterange" Title="Start date"
    							   Width="210" EndDateField="dateFieldEndDate" >
    				</ext:DateField>
    				<ext:DateField ID="dateFieldEndDate" runat="server" Vtype="daterange" Title="End date"
    							   Width="210" StartDateField="dateFieldStartDate" >
    				</ext:DateField>
           			<ext:Button ID="btnLeadtime" Text="Search" runat="server" Hidden="false" Icon="Magnifier">
                        <DirectEvents>
                            <Click OnEvent="SearchLeadtime"/>
                        </DirectEvents>
                	</ext:Button>
    			</Items>
    		</ext:Panel>
        </form>
    </body>
    </html>
    I hope clear.
    Thanks.
    Regards.
  4. #4
    I guess this
    dateFieldStartDate
    should be replaced with
    dateFieldStartDate.Text
    , should not?

    Quote Originally Posted by tactime10 View Post
    In the example below, when I click on the search button and the "dateFieldEndDate" is empty I can see in the messagebox that "dateFieldEndDate" displays different value if I run the page with different browser language.
    Well, serializing dates depends on a culture. You can use the SelectedDate property instead of the Text one and serialize it as you need.
  5. #5
    Hi,

    yes , must be dateFieldStartDate.Text
    I replaced this string in the code below

    <%@ Page Language="C#" %>
     
    <%@ Import Namespace="System.Xml" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <script runat="server">
     
        protected void SearchLeadtime(object sender, DirectEventArgs e)
        {
           X.Msg.Alert("Status", " dateFieldStartDate: " + dateFieldStartDate.Text  + " - dateFieldEndDate : " + dateFieldEndDate.Text).Show();
        }
    </script>
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Examples</title>
     
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Flex="1" Layout="HBoxLayout" Border="false" AutoHeight="true" Header="false">
                <Defaults>
                    <ext:Parameter Name="margins" Value="5 5 0 5" Mode="Value" />
                </Defaults>
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Padding="3" Align="Middle" />
                </LayoutConfig>
                <Items>
                    <ext:DateField ID="dateFieldStartDate" runat="server" Vtype="daterange" Title="Start date"
                                   Width="210" EndDateField="dateFieldEndDate" >
                    </ext:DateField>
                    <ext:DateField ID="dateFieldEndDate" runat="server" Vtype="daterange" Title="End date"
                                   Width="210" StartDateField="dateFieldStartDate" >
                    </ext:DateField>
                    <ext:Button ID="btnLeadtime" Text="Search" runat="server" Hidden="false" Icon="Magnifier">
                        <DirectEvents>
                            <Click OnEvent="SearchLeadtime"/>
                        </DirectEvents>
                    </ext:Button>
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
  6. #6
    I used the property SelectedDate as you said me,
    but when I run my page I see the field inizialized with value of the SelectedDate
    property instead I want to see the field empty.

    The code below use the SelectedDate property.
    
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Xml" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
        protected void SearchLeadtime(object sender, DirectEventArgs e)
        {
           X.Msg.Alert("Status", " dateFieldStartDate: " + dateFieldStartDate.Text + " - dateFieldEndDate : " + dateFieldEndDate.SelectedDate).Show();
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Examples</title>
    
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Flex="1" Layout="HBoxLayout" Border="false" AutoHeight="true" Header="false">
                <Defaults>
                    <ext:Parameter Name="margins" Value="5 5 0 5" Mode="Value" />
                </Defaults>
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Padding="3" Align="Middle" />
                </LayoutConfig>
        		<Items>
    				<ext:DateField ID="dateFieldStartDate" runat="server" Vtype="daterange" Title="Start date"
    							   Width="210" EndDateField="dateFieldEndDate" >
    				</ext:DateField>
    				<ext:DateField ID="dateFieldEndDate" runat="server" Vtype="daterange" Title="End date"
    							   Width="210" StartDateField="dateFieldStartDate" SelectedDate="01/01/1900" >
    				</ext:DateField>
           			<ext:Button ID="btnLeadtime" Text="Search" runat="server" Hidden="false" Icon="Magnifier">
                        <DirectEvents>
                            <Click OnEvent="SearchLeadtime"/>
                        </DirectEvents>
                	</ext:Button>
    			</Items>
    		</ext:Panel>
        </form>
    </body>
    </html>
    How can to do it?

    Thanks
  7. #7
    Sorry, I don't quite understand.

    Why do you set up the SelectedDate property if you need an empty DateField?
  8. #8
    I thought that I setting the SelectedDate property it fixed the hidden value of dateField
    when the dateField is empty and the search button is clicked.
    In any way I want to set hidden value the dateField with fixed value
    when is empty so the hidden value not change with different browser language.

    I hope clear
    Thanks.
    Regards
  9. #9
    Can you post screenshots and say browser and languages.
    Last edited by Baidaly; Apr 11, 2013 at 4:27 AM.
  10. #10
    Hi,

    the pages displayed into the pictures show the message with hidden value after click on the search button.
    The browser is Firefox 20, also I tried with Chrome and the page behaves in the same way.
    For each screen shot there is the hidden value of dateField and browser language setting
    for to show the different values displayed into the page.

    Click image for larger version. 

Name:	Cattura.JPG 
Views:	32 
Size:	90.6 KB 
ID:	5998

    Click image for larger version. 

Name:	Cattura1.JPG 
Views:	24 
Size:	89.8 KB 
ID:	5999
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] TriggerField Text property is empty
    By supera in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 09, 2012, 9:12 AM
  2. Replies: 3
    Last Post: Mar 25, 2011, 9:55 AM
  3. [CLOSED] Combo SelectedItem.Text Property Empty
    By CMA in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 19, 2010, 10:19 AM
  4. [CLOSED] Empty values from text fields
    By CSG in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 21, 2009, 10:14 AM
  5. [CLOSED] MultiSelect and text items with comma in Text property
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 15, 2009, 2:30 PM

Posting Permissions