in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Appointment Not Showing

Last post 11/10/2008 11:17 AM by Adrian Creegan. 4 replies.
Page 1 of 1 (5 items)
Sort Posts:
Previous Next
  • 10/1/2008 12:01 PM

    Appointment Not Showing

     When I add new appointments to the schedule, they do not show up unless I click on the Today button at the top of the schedule.  I'm using a custom appointment form, if that makes any difference.

    Is there a way to get the calendar to refresh after inserting an appointment?

    Thanks,

    -Pete

    Filed under:
  • 10/6/2008 9:27 AM In reply to

    Re: Appointment Not Showing

    Hi Pete,

    Please review the CodeCentral example Custom form, custom fields and custom actions on reminder alert, illustrating the custom appointment form. Could you reproduce the problem by changing the code of this example? If the problem persists, please ask our Support team for assistance and submit a sample project, demonstrating the incorrect behavior, to our Support Center

    Regards, Brian.
    R&D, .NET Team, Developer Express Inc.
  • 11/10/2008 9:32 AM In reply to

    Re: Appointment Not Showing

    I too am experiencing a similar problem using a custom appointment template implemented using the sample you have suggested.  The only difference between the sample and my code is I am binding the control using the DataSource/DataMember elements to an underlying data set (as opposed to a ObjectDataSource control).  If I do not use a custom template (i.e. use the AppointmentForm with default controller, container and savecallbackcommand objects) everything works fine, I can add update and delete items and the changes are correctly reflected in the data set and the browser.  If however I use custom classes for the form, controller, container and savecallback command the change is recorded in the data set but does not appear in the browser until the next callback occurs; it is as if the changed record is not rendered as part of the page rendering back to the client but will be picked up on the next load of the view state.  To clarify, if I have an appointment on the screen and update it's subject, the whole appointment dissappears from the control until I select another appointment for edit at which stage the lost appointment is displayed (greyed in background behind the new appointment form) with the updated subject value.  I am obviously missing some sort of update command/end edit notification but I can't seem to see any such call in your example code.

    Please help, I am up against a tight deadline and am seriously reconsidering your toolkit.

    Regards,

    Adrian.

  • 11/10/2008 9:59 AM In reply to

    Re: Appointment Not Showing

     OK, I seem to have made a bit more progress in understanding the problem (the code is still busted).  My problem appears to be (I think) related to my implementation of the SaveCallbackCommand.AssignControllerValues() implementation.  If I use my controller/container/callbackcommand code with the unaltered AppointmentForm control and I use the base.AssignControllerValues() implementation, everything works fine.

    If I use my override code for the AssignControllerValues() it fails as before (even with the AppointmentForm control implementation).  This would suggest I think that I am not finalizing some sort of state as part of this operation.  My code is as follows:

     

     

     

     

     

     

     

     

    protected override void AssignControllerValues() {

     

     

    ASPxTextBox tbSubject = (ASPxTextBox)FindControlByID("tbSubject");

     

     

    ASPxDateEdit edtStartDate = (ASPxDateEdit)FindControlByID("edtStartDate");

     

     

    ASPxDateEdit edtEndDate = (ASPxDateEdit)FindControlByID("edtEndDate");

     

     

    ASPxComboBox cbResource = (ASPxComboBox)FindControlByID("edtResource");

    Controller.Subject = tbSubject.Text;

    Controller.ResourceId = cbResource.SelectedItem.Value;

    Controller.Start = edtStartDate.Date;

    Controller.End = edtEndDate.Date;

     

    // base.AssignControllerValues();

    }

    Please note that I cannot use the base.AssignControllerValues() in my own code as I have removed some of the fields from my version of the ApppointmentForm and it will end up throwing an exception.

    Thanks,

    Adrian.

  • 11/10/2008 11:17 AM In reply to

    Re: Appointment Not Showing

     Hi all, I have fixed my problem (had to resort to dissasembling the AppointmentFormSaveCallbackCommand::AssignControllerValues() implementation in order to do so).  The problem seems to be with this line (from the example code):

    if (cbResource.SelectedItem != null)
                 Controller.ResourceId = cbResource.SelectedItem.Value;

    which fails in my code because ResourceId is an integer and cbResource.SelectedItem.Value is a string (though the assignment succeeds as they are both object types).

    The correct code (as implemented in the AppointmentFormSaveCallbackCommand) is something along the lines of:

    if (cbResource.SelectedItem != null)
                 Controller.ResourceId = CalculateResourceId(cbResource.Value);

    Regards,

    Adrian.

Page 1 of 1 (5 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED