Welcome Guest Search | Active Topics | Sign In | Register

DatePicker not setting selecteddate Options
Zachariah
Posted: Friday, December 7, 2007 9:30:12 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
Hi I have three date picker controls on one page. I have not yet bought a license because I am still evaluating your product. But....

I have some code that looks like this on page load:

Code: Visual Basic.NET
Me.txtDateReported.SelectedDate = _issue.DateReported


I step through it with the debugger and it looks like it is setting the selecteddate just fine but then when the page loads the text box is empty. It only shows " / / "

Am I doing something wrong or is this a limitation with not having a license? Do you know why this would be happening?

Thank you,

Zach
eo_support
Posted: Friday, December 7, 2007 9:48:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi,

You must have set it again somewhere else. You can verify this by creating a blank web form and then do:

DatePicker1.SelectedDate = DateTime.Now

And you will see DatePicker displays the date correctly.

Thanks
Zachariah
Posted: Friday, December 7, 2007 10:51:28 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
I have checked and rechecked even removed everything in the page load event and changed the code to below. And it still did not work....

Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

txtDateReported.SelectedDate = Convert.ToDateTime("12/01/2007")

    End Sub



I created a new page with only a datepicker on it and used the same code as above and it worked fine.. Is there anything else that you know of that might interfere with your code?
eo_support
Posted: Friday, December 7, 2007 10:54:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi,

No. We can not think of anything else that can interfere with it. Please post the complete .aspx and .vb code and we would be happy to take a look.

Thanks
Zachariah
Posted: Friday, December 7, 2007 11:09:01 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
I think I have discovered the problem...

I have a search page with 3 datepicker controls and I have an edit page with 3 datepicker controls.
After I perform a search I display a list of results with an edit button next to each item. That button does a server.transfer to the edit page and populated the fields.

1. If I did not select a date from the search page the datepicker remains empty on the edit page.
2. If I select a date on the search page the datepicker is populated with the same date that was selected on the search page datepicker.
3. If I visit the edit page using a url such as Detail.aspx?id=<ITEMID> all of the datepickers are populated correctly.
4. If I rename the 3 datepickers on the edit page so they are not the same as on search page they are populated correctly.

So I think the problem is when server.transfer is used????
eo_support
Posted: Friday, December 7, 2007 11:27:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Zach,

There is really nothing special here. You give our DatePicker a value and we keep it until the page is discarded (Server.Transer will do exactly that). It's as simple as that. If it has an empty value, you must either have not set anything or have cleared it.

Also, I am not sure what you mean by "That button does a server.transfer to the edit page and populated the fields". When you do a Server.Transfer it goes to another page. And whatever additional action, such as populating the fields, must be done in that page. It would have nothing to do with the previous page.

Our DatePicker has been out for a long time and it's unlike to have this kind of problems. If you believe it's our problem, please isolate the problem into a separate test page and post the page source, we will be happy to take a look.

Thanks
Zachariah
Posted: Friday, December 7, 2007 11:51:24 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
Here is the HTML for Page 1
Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb" Inherits="PIMRA.WebUI.test"%>
<%@ Register TagPrefix="eo" NameSpace="EO.Web" Assembly="EO.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>test</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			<P>
				<eo:datepicker id="txtDateReported" runat="server" DayHeaderFormat="Short" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
					DayCellHeight="15" DayCellWidth="31" TitleRightArrowImageUrl="DefaultSubMenuIcon" TitleFormat="MMMM, yyyy"
					OtherMonthDayVisible="True" Width="100px">
					<DayHoverStyle CssText="background-image:url('00040402');color:#1c7cdc;"></DayHoverStyle>
					<TitleStyle CssText="font-family:Verdana;font-size:8.75pt;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;"></TitleStyle>
					<DayHeaderStyle CssText="border-bottom: #f5f5f5 1px solid"></DayHeaderStyle>
					<SelectedDayStyle CssText="background-image:url('00040403');color:Brown;"></SelectedDayStyle>
					<FooterTemplate>
						<table style="font-size: 11px; font-family: Verdana" border="0" cellSpacing="5" cellPadding="0">
							<tr>
								<td width="30"></td>
								<td valign="center"><img src="{img:00040401}"></td>
								<td valign="center">Today: {var:today:MM/dd/yyyy}</td>
							</tr>
						</table>
					</FooterTemplate>
					<TitleArrowStyle CssText="cursor: hand"></TitleArrowStyle>
					<TodayStyle CssText="background-image:url('00040401');color:#1176db;"></TodayStyle>
					<PickerStyle CssText="background-color:#ffffcc;border-bottom-color:#6197ce;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#6197ce;border-left-style:solid;border-left-width:1px;border-right-color:#6197ce;border-right-style:solid;border-right-width:1px;border-top-color:#6197ce;border-top-style:solid;border-top-width:1px;"></PickerStyle>
					<CalendarStyle CssText="background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;"></CalendarStyle>
					<DisabledDayStyle CssText="color: gray"></DisabledDayStyle>
					<MonthStyle CssText="cursor:hand;font-family:Verdana;font-size:8pt;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;"></MonthStyle>
				</eo:datepicker> 
			</P>
			<P>
				<asp:Button id="btnTransfer" runat="server" Text="Transfer"></asp:Button></P>
		</form>
	</body>
</HTML>
Zachariah
Posted: Friday, December 7, 2007 11:52:02 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
Here is the codebehind for page 1:

Code: Visual Basic.NET
Public Class test
    Inherits PIMRA.Base.BasePage

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtDateReported As EO.Web.DatePicker
    Protected WithEvents btnTransfer As System.Web.UI.WebControls.Button

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Private Sub btnTransfer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTransfer.Click
        Server.Transfer("test2.aspx")
    End Sub
End Class
Zachariah
Posted: Friday, December 7, 2007 11:52:44 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
Here is the HTML for page2:

Code: HTML/ASPX
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="test2.aspx.vb" Inherits="PIMRA.WebUI.test2"%>
<%@ Register TagPrefix="eo" NameSpace="EO.Web" Assembly="EO.Web" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>test2</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			<eo:datepicker id="txtDateReported" runat="server" Width="100px" OtherMonthDayVisible="True" TitleFormat="MMMM, yyyy"
				TitleRightArrowImageUrl="DefaultSubMenuIcon" DayCellWidth="31" DayCellHeight="15" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
				DayHeaderFormat="Short">
				<DayHoverStyle CssText="background-image:url('00040402');color:#1c7cdc;"></DayHoverStyle>
				<TitleStyle CssText="font-family:Verdana;font-size:8.75pt;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;"></TitleStyle>
				<DayHeaderStyle CssText="border-bottom: #f5f5f5 1px solid"></DayHeaderStyle>
				<SelectedDayStyle CssText="background-image:url('00040403');color:Brown;"></SelectedDayStyle>
				<FooterTemplate>
					<table style="font-size: 11px; font-family: Verdana" border="0" cellSpacing="5" cellPadding="0">
						<tr>
							<td width="30"></td>
							<td valign="center"><img src="{img:00040401}"></td>
							<td valign="center">Today: {var:today:MM/dd/yyyy}</td>
						</tr>
					</table>
				</FooterTemplate>
				<TitleArrowStyle CssText="cursor: hand"></TitleArrowStyle>
				<TodayStyle CssText="background-image:url('00040401');color:#1176db;"></TodayStyle>
				<PickerStyle CssText="background-color:#ffffcc;border-bottom-color:#6197ce;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#6197ce;border-left-style:solid;border-left-width:1px;border-right-color:#6197ce;border-right-style:solid;border-right-width:1px;border-top-color:#6197ce;border-top-style:solid;border-top-width:1px;"></PickerStyle>
				<CalendarStyle CssText="background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;"></CalendarStyle>
				<DisabledDayStyle CssText="color: gray"></DisabledDayStyle>
				<MonthStyle CssText="cursor:hand;font-family:Verdana;font-size:8pt;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;"></MonthStyle>
			</eo:datepicker>
		</form>
	</body>
</HTML>
Zachariah
Posted: Friday, December 7, 2007 11:53:23 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
Here is the code behind for page 2:

Code: Visual Basic.NET
Public Class test2
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents txtDateReported As EO.Web.DatePicker

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not Page.IsPostBack Then
            Me.txtDateReported.SelectedDate = Convert.ToDateTime("12/12/2022")
        End If
    End Sub

End Class
Zachariah
Posted: Friday, December 7, 2007 11:55:22 AM
Rank: Newbie
Groups: Member

Joined: 12/7/2007
Posts: 9
I made a typo on this sentence "That button does a server.transfer to the edit page and populated the fields". The fields are populated by the edit page on page-load..


If try the pages I posted you will see that if you leave the first datepicker empty the second one on the next page will not be populated. (I am using .NET 1.1)
eo_support
Posted: Friday, December 7, 2007 12:04:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Thanks for the detailed information and test code. We are looking into it and will get back to you as soon as we find anything.
eo_support
Posted: Friday, December 7, 2007 12:23:11 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,098
Hi Zach,

It does appear to be related to Server.Transfer. Server.Transfer keeps all form variable while transfering to the new page and that seems to be interfering with our controls. A cleaner, but slightly less efficient solution is to use Response.Redirect instead. That should work correct.

Please accept our apology for hasting to the conclusion without seeing the code. We will look into the detail and see what we can do with Server.Transfer. In the mean time, please let us know whether Response.Redirect works for you.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.