Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
654
Reminder Questions
posted

Hello -

I've been using the WebSchedule components to see how difficult our implementation will be.  In doing so I've run into some quirks of the reminder features.  Any insight on the items below would be appreciated:

 

1) Snooze Functionality - It doesn't look like the original data structures account for storing snooze information.  I also see that there are 2 different persistance types for snooze information (Cookie and ControlState).  I didn't notice any difference when using these two.  When I refresh the page I always get reminders for the items I previously snoozed.  Is there a trick to this that I'm missing?  I'm just setting the SnoozePersistenceType on my custom DataProvider.  Should I have implemented something to handle this?

 

2) Reminders and Recurrence - When a reminder is dismissed, I see the UpdateReminder event firing, which is great.  The problem is that the same event seems to fire when dismissing a recurring event and a standard activity - but it sends in a recurrenceID (not an activityID) when dismissing a recurring event.  I haven't seen a way to distinguish whether I should update a recurrence or a standard activity.  The UpdateRemindersContext has no way to tell between the two.  Complicating this is the fact that recurrences seem to be added to the reminder list by default.  I'm not adding them in my FetchReminders method, but reminders are popping up for them (and I can't dismiss them properly).  Has anyone else noticed these problems?

Parents
  • 4960
    posted

    brassier said:

    1) Snooze Functionality - It doesn't look like the original data structures account for storing snooze information.  I also see that there are 2 different persistance types for snooze information (Cookie and ControlState).  I didn't notice any difference when using these two.  When I refresh the page I always get reminders for the items I previously snoozed.  Is there a trick to this that I'm missing?  I'm just setting the SnoozePersistenceType on my custom DataProvider.  Should I have implemented something to handle this?

    If you are using a custom data provider, you need to implement IDataUpdate::Update(DataContext dc).  Your Update implementation will be passed a DataContext that is an UpdateSnoozeContext (identifiable by inspecting its Operation property which will be "UpdateSnooze").

    If you are subclassing one of the built-in data providers, then if you call base.Update( dc) passing your DataContext for those operations you do not handle at the end of your Update method -- you can reuse the data provider's built-in implementation of Cookie and ControlState persistence. e.g.,

    public override void Update( DataContext dc) {
       if ( dc.Operation.CompareTo("UpdateActivity") == 0) {
          UpdateActivityContext ctx = dc as UpdateActivityContext;
          // ... custom code to implement update activity operation
          // ...
       } else if ( dc.Operation.CompareTo("RemoveActivity") == 0) {
          RemoveActivityContext ctx = dc as RemoveActivityContext;
          // custom code to implement remove activity operation
          // ...
       } else {
          // any operations not handled, let base class handle
          base.Update( dc);
       }
    }

    If you are not subclassing, then in a pinch you can construct a new WebScheduleDataProviderBase-derived control, add it to the Page's Controls collection, set its SnoozePersistenceType to your desired snooze method, and then for UpdateSnoozeContext only delegate your Update call to it.  It will not require a database connection to do it's thing to the page's cookies or the list of snoozes on the UpdateSnoozeContext.  Here is some pseudocode for this:

    // initialize field once during your data provider's initialization
    this.snoozeDataProvider = new WebScheduleOleDbDataProvider( );
    this.snoozeDataProvider.SnoozePersistenceType = SnoozePersistenceType.Cookie;
    // need this next step so DP can access Cookies collection w/o null reference
    this
    .Page.Controls.Add( this.snoozeDataProvider);  

    // . . .

    // later, inside your Update method's implementation
    if ( dc.Operation.CompareTo( "UpdateSnooze") == 0 ) {
        // re-use Infragistics implementation of snooze updates
        this.snoozeDataProvider.Update( dc);
    }

    (Of course, you can alternately implement snooze updates to the Page's Response's Cookies collection yourself without resulting to this delegation, it'd just take me a little more in the way of sample code I don't have with me.)

Reply Children