in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1WebDateEdit does not keep value

Last post 12-11-2007 4:20 PM by C1_GregL. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 04-12-2007 10:36 AM

    C1WebDateEdit does not keep value

    Hi,

    I'm experiencing a strange behavior of the lastest version of the C1WebDateEdit component inside an update panel of ajax (final). I put two C1WebDateEdit fields and a button inside the update panel. When I click on the button I want to get data from a database. The datatable has a timestamp field and want only data where the timestamp value is between the value of the two C1WebDateEdit fields.
    When I click on the button the value of both C1WebDateEdit fields is reduced by one hour without me doing anything.
    How is this possible? Could it be a problem with daylight saving time, because we had a timechange a few weeks ago here in germany?

    Right now the component is pretty much useless because it is impossible to get the value I want. For example if I set the datefields to today 2pm and today 4pm, I get today 1pm and today 3pm.

    I set a breakpoint to
    protected void Page_Load(object sender, EventArgs e)
    and at that point the values have already changed.


    Regards,

    Tobi
  • 09-19-2007 2:40 AM In reply to

    Re: C1WebDateEdit does not keep value

    Please try this new dll for the C1WebInput attached. As this build is not tested by our QA team; I would request you to please take a backup of your Application before updating this build in your Application.

    This new build of the dll will send Date to server and back in a different format using string "Year, Month, Day, Hour, Minutes, Seconds, Milliseconds" currently it sends via one value - Total Milliseconds
    Regards,
    Patrick
    <ITActive> wrote in message news:193383@10.0.1.98...
    Hi,

    I'm experiencing a strange behavior of the lastest version of the C1WebDateEdit component inside an update panel of ajax (final). I put two C1WebDateEdit fields and a button inside the update panel. When I click on the button I want to get data from a database. The datatable has a timestamp field and want only data where the timestamp value is between the value of the two C1WebDateEdit fields.
    When I click on the button the value of both C1WebDateEdit fields is reduced by one hour without me doing anything.
    How is this possible? Could it be a problem with daylight saving time, because we had a timechange a few weeks ago here in germany?

    Right now the component is pretty much useless because it is impossible to get the value I want. For example if I set the datefields to today 2pm and today 4pm, I get today 1pm and today 3pm.

    I set a breakpoint to
    protected void Page_Load(object sender, EventArgs e)
    and at that point the values have already changed.


    Regards,

    Tobi

    http://helpcentral.componentone.com/cs/forums/p/70909/193383.aspx#193383

  • 11-08-2007 3:25 PM In reply to

    • rlkery
    • Not Ranked
    • Joined on 04-12-2006
    • Posts 3

    Re: C1WebDateEdit does not keep value

    I am experiencing the same issue.  This issue appears to be an error with the Javascrip used.  When I select a day, the day decreases by one after a button is clicked, which causes a form to post.  Is there a fix to this issue?  I need a fix ASAP.  It appears this issue was reported a long time ago, so I would expect a fix by now.

  • 11-09-2007 2:48 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: C1WebDateEdit does not keep value

    Hi,

    I've tested this scenario with our latest release and prerelease and I havne't been able to replicate this issue. 

    In an AJAX updatePanel on a button click event this works:
       TextBox1.Text = C1WebDateEdit1.Date

    In javascript these also work for me
       document.getElementById("TextBox1").value = <%=C1WebDateEdit1.ClientObjectID%>.get_Date();
       document.getElementById("TextBox1").value = document.getElementById("C1WebDateEdit1").value;

    So can you please explain how you are working with C1WebDateEdit?  Perhaps post sample code.

    Or you can try the latest version off our prerelease site here:

    http://prerelease.componentone.com/dotnet20/c1webinput/2007-t3/C1WebInput.2_2.0.20073.427.zip 

    Regards,
    Greg L

  • 11-27-2007 10:54 AM In reply to

    • rlkery
    • Not Ranked
    • Joined on 04-12-2006
    • Posts 3

    Re: C1WebDateEdit does not keep value

    Greg,
     I am not using an update panel, but I am experiencing a similar problem.  I have used the Studio Live Utility to get the latest versions of C1.Web.Calendar.2.dll and C1.Web.C1Input.2.dll.  These newer assemblies are causing strange behavior with the calendar control.  I am also experiencing strange behavior with the previous release. 

    New Release Issue (C1WebInput.2_2.0.20073.429) - The calendar displays and then quickly disappears when the down arrow image is clicked.

    Old Release issue - If there are two input controls and two calendar controls on a form, the date does not stick on one of the controls.  In my case, I have a start date and end date.  The start date goes back one day when the form posts.  It appears to be some sort of date rounding issue.

    Code used
    <script>
    window.edit = null;
       
        function StartDateDropCalendar(aC1Edit)
        {
            window.edit = aC1Edit;
           
            var d = aC1Edit.get_Date();
            StartDate_Client.UnSelectAll();
            StartDate_Client.SelectDate(d);
            StartDate_Client.DisplayDate = d;
            StartDate_Client.PopupSetting.Dock = c1_dock_bottomleft;
            StartDate_Client.PopupBeside(aC1Edit.getInputElement());
        }
      
       function StartDate_Calendar_SelChange(calendar, seltype, seldates)
        {
            if (calendar)
            {
                if (window.edit)
                {
                    window.edit.set_Date(calendar.SelectedDate);
                }
            }
        }
       
        function StartDate_Calendar_OnClose(calendar)
        {
            if (calendar)
                document.all("TextBox1").value = calendar.SelectedDate;
        }
       
       
        function EndDateDropCalendar(aC1Edit)
        {
            window.edit = aC1Edit;
           
            var d = aC1Edit.get_Date();
            EndDate_Client.UnSelectAll();
            EndDate_Client.SelectDate(d);
            EndDate_Client.DisplayDate = d;
            EndDate_Client.PopupSetting.Dock = c1_dock_bottomleft;
            EndDate_Client.PopupBeside(aC1Edit.getInputElement());
        }
      
       function EndDate_Calendar_SelChange(calendar, seltype, seldates)
        {
            if (calendar)
            {
                if (window.edit)
                {
                    window.edit.set_Date(calendar.SelectedDate);
                }
            }
        }
       
        function EndDate_Calendar_OnClose(calendar)
        {
            if (calendar)
                document.all("TextBox1").value = calendar.SelectedDate;
        }
       
    </script>

     

    <table>
     <tr>
      <td align="left" style="width: 136px">
       <asp:Label ID="lblStart" runat="server" Text="Start Date:"></asp:Label>
      </td>
      <td align="left" style="width: 178px; height: 29px;">
       <c1i:C1WebDateEdit ID="StartDateEdit" runat="server" CustomButtonAlign="Right"
           OnClientCustomButtonClick="StartDateDropCalendar" OnClientInit="SetDate" Text="1/1/0001">
       </c1i:C1WebDateEdit>
       
       <cc1:C1WebCalendar ID="StartDate" runat="server" BorderColor="Silver" BorderStyle="Solid"
      BorderWidth="1px" ClientOnSelChange="StartDate_Calendar_SelChange" Font-Names="Arial,Verdana,Tahoma"
      Height="143px" PopupMode="True" SelectionMode="Day, Days, WeekDay, WeekNumber, Month"
      Style="border-left-color: #ececec; border-bottom-color: #ececec; border-top-color: #ececec;
      border-right-color: #ececec" WeekDayFormat="FirstTwoLetters" Width="199px">
      <TitleStyle CssText="background-color:#d7d7e5;" />
      <MonthViewStyle CssText="cursor:hand;text-align:center;font:normal 11px Arial, Verdana, Sans-Serif;text-decoration:none;">
      </MonthViewStyle>
      <WeekDayStyle CssText="font-size:12px !important;border-bottom:solid 1px #d5d5d5;cursor:default !important;line-height:24px;">
      </WeekDayStyle>
      <WeekNumberStyle CssText="font-size:10px !important;border-right:solid 1px #d5d5d5;cursor: default !important;line-height:24px;">
      </WeekNumberStyle>
      <NextPreviewStyle CssText="background-color:#d7d7e5;text-align:center;width:8px;">
      </NextPreviewStyle>
      <PrevPreviewStyle CssText="background-color:#d7d7e5;text-align:center;width:8px;">
      </PrevPreviewStyle>
      <OtherMonthDayStyle CssText="color: #c6c6c6;" />
      <DayStyleHover CssText="background:#d7d7e5;cursor:default;">
      </DayStyleHover>
      <SelectedDayStyle CssText="background-color:#e2e5ee;" />
      <TodayDayStyle CssText="font:bold;border:solid 1px #bb5503;" />
         </cc1:C1WebCalendar>
      </td>
     </tr>
     <tr>
      <td align="left" style="width: 136px">
       <asp:Label ID="lblEndDate" runat="server" Text="End Date:"></asp:Label>
      </td>
      <td>
       <c1i:C1WebDateEdit ID="EndDateEdit" runat="server" CustomButtonAlign="Right"
            OnClientCustomButtonClick="EndDateDropCalendar" Text="1/1/0001" Date="">
           </c1i:C1WebDateEdit>
          
           <cc1:C1WebCalendar ID="EndDate" runat="server" BorderColor="Silver" BorderStyle="Solid"
      BorderWidth="1px" ClientOnSelChange="EndDate_Calendar_SelChange" Font-Names="Arial,Verdana,Tahoma"
      Height="143px" PopupMode="True" SelectionMode="Day, Days, WeekDay, WeekNumber, Month"
      Style="border-left-color: #ececec; border-bottom-color: #ececec; border-top-color: #ececec;
      border-right-color: #ececec" WeekDayFormat="FirstTwoLetters" Width="199px" SelectedDate="">
      <TitleStyle CssText="background-color:#d7d7e5;" />
      <MonthViewStyle CssText="cursor:hand;text-align:center;font:normal 11px Arial, Verdana, Sans-Serif;text-decoration:none;">
      </MonthViewStyle>
      <WeekDayStyle CssText="font-size:12px !important;border-bottom:solid 1px #d5d5d5;cursor:default !important;line-height:24px;">
      </WeekDayStyle>
      <WeekNumberStyle CssText="font-size:10px !important;border-right:solid 1px #d5d5d5;cursor: default !important;line-height:24px;">
      </WeekNumberStyle>
      <NextPreviewStyle CssText="background-color:#d7d7e5;text-align:center;width:8px;">
      </NextPreviewStyle>
      <PrevPreviewStyle CssText="background-color:#d7d7e5;text-align:center;width:8px;">
      </PrevPreviewStyle>
      <OtherMonthDayStyle CssText="color: #c6c6c6;" />
      <DayStyleHover CssText="background:#d7d7e5;cursor:default;">
      </DayStyleHover>
      <SelectedDayStyle CssText="background-color:#e2e5ee;" />
      <TodayDayStyle CssText="font:bold;border:solid 1px #bb5503;" />
      <SelectedDates>
          <cc1:C1Date Date="" />
      </SelectedDates>
         </cc1:C1WebCalendar>
      </td>
     </tr>
    </table>

  • 12-11-2007 4:20 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 515

    Re: C1WebDateEdit does not keep value

    Hi

    This new issue is being addressed (issue id ANINP000195).  The last version of C1WebInput that appears to work with a popup WebCalendar is 20072.420.  I'm attaching this version with this post for your to try.  I was not able to reproduce your original error, so if you still receive the error please describe how to simulate it with your code above. 

    I was able to read the date both server side and client side correctly (using build 420)

    Client: alert(document.getElementById("StartDateEdit").value.toString());

    Server: Response.Write(StartDateEdit.Date.ToString())

    Regards,
    Greg L

Page 1 of 1 (6 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.