Postback Selection

8 posts, 0 answers
  1. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 09 Jun 2011 Link to this post

    Hi sorry I think I posted about this a while ago, but I can't find it (or the resolution)

    http://screencast.com/t/mcJ4tM7K8tGK

    The client state of the control remembers the selected dates, but once it re-renders after a postback none of the <td> tags have the rcSelected class applied...I have to hover-over the element to get it to show back up.
  2. Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 14 Jun 2011 Link to this post

    Hello Steve,

    This happens because Firefox caches the values of the <input> elements where RadCalendar keeps its state (selected dates, focused date, etc.). As a work around you can manually clear the selected dates from the calendar, for example on the client-side Load event of the control:

    ASPX:
    <telerik:RadCalendar ID="RadCalendar1" runat="server" ClientEvents-OnLoad="clearSelection" />

    JavaScript:
    function clearSelection(sender, eventArgs) {
                var calendar = sender;
                var dates = calendar.get_selectedDates();
                for (var i = 0; i < dates.length; i++) {
                    var date = dates[i];
                    calendar.unselectDate(date);
                }
            }

    And if the dates are actually checked you could loop thought calendar's cells and change their styles. Or use the OnDayRender client event for setting the styles.

    Greetings,
    Vasil
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 14 Jun 2011 Link to this post

    Is this not a bug then?...I don't know of any other control in this suite that I have to manually go in and clear out values which shouldn't be set.

    Can you guys internally just not do this

    $telerik.isFirefox then run the code below?

    I mean I'd have to remember to do this on literally EVERY radcalendar I use...and that sucks :(
  4. Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 15 Jun 2011 Link to this post

    Hi Steve,

    I was able to reproduce the problem when refreshing the page in Firefox using the reload button(or hitting F5), we will do further research on what exactly causes the problem and we will fix it if it is possible.

    However, making regular PostBack doesn't trigger such an issue on my side. For example if I add a calendar and a button for making a PostBack and then select some values and click the button. After the page loads selected dates will have selected style applied. Could you show us the code that you used in your demonstration for helping us to reproduce the same issue?

    All the best,
    Vasil
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 15 Jun 2011 Link to this post

    Not much to it really... :)

    <ul>
        <li>
            <h6>Standard</h6>
            <telerik:RadCalendar ID="RadCalendar2" runat="server" DbSelectedDate='<%= DateTime.Now %>'  />
        </li>
        <li>
            <h6>No Week Row</h6>
            <telerik:RadCalendar ID="RadCalendar3" runat="server" ShowRowHeaders="false" />
        </li>
        <li>
            <h6>Multi Month</h6>
            <telerik:RadCalendar ID="RadCalendar1" runat="server" MultiViewColumns="2" MultiViewRows="2" />
        </li>
    </ul>

    ..and here's my skin

    <telerik:RadCalendar runat="server" Skin="Medportal" EnableEmbeddedSkins="False" DayNameFormat="Short"  ShowRowHeaders="false" />
  6. Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 20 Jun 2011 Link to this post

    Hello Steve,

    We still can't replicate the problem in sample page using regular post-back. Check this video and the attached web site. If you are able to reproduce it in this page, please feel free to do some modifications of the code and send it back to us to continue further debugging on our side.

    All the best,
    Vasil
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  7. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 20 Jun 2011 Link to this post

    Here, using teleriks own demo site :)

    http://screencast.com/t/CHth8jhl

    Shows the calendar selection being gimpy after a refresh, but the RadGrid handles it properly
  8. Vasil
    Admin
    Vasil avatar
    1640 posts

    Posted 21 Jun 2011 Link to this post

    Hi Steve,

    Thank you the effort to providing us a feedback. As I mentioned before, we are aware that this issue occurs when using F5 or refresh button and our developers are researching if there is any way of solving this problem that happens only in Firefox. I was asking if you observed such an issue when PostBack using a button in the page.

    Greetings,
    Vasil
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top