Error saving time in schedule in EditTemplate when RecurrenceRule is present

Hi everybody,

  I created a schedule sample with TemplateStudio and changed one event to use a RecurrenceRule. Changing the time to another value ist not saved. The same seems to work with no RecurrenceRule being involved with the other events.

In my application OnActionCompleted is not called either which might refer to this error. 


Another minor issue:

It is not possible to change the locale in the DropdownList. (see attached code and videos). 
Hint: Remove the index property in CultureSwitcher.razor in SfDropdownList.

   regards

      Uwe

Attachment: SchedRecurrenceTest_736b1c16.zip

5 Replies

HB Hareesh Balasubramanian Syncfusion Team August 6, 2020 01:15 PM UTC

Hi Uwe, 

Greetings from Syncfusion Support..! 

We have validated your both the queries at our end. And for that we have modified your shared sample and it can be downloaded from the below link, 

Q1: Changing the time to another value ist not saved. The same seems to work with no RecurrenceRule being involved with the other events. 
 
We have validated your shared code snippets at our end. And we found that you are using editorTemplate for the Scheduler but you didn’t render the Recurrence field that could be the reason for the reported problem. And for further reference, kindly refer the below code snippets, 
 
Code snippet: 
        <ScheduleTemplates> 
            <EditorTemplate> 
                <table class="custom-event-editor" width="100%" cellpadding="5"> 
                    <tbody> 
                        <tr> 
                            <td class="e-textlabel">Summary</td> 
                            <td colspan="4"> 
                                <SfTextBox ID="Subject" CssClass="e-field e-input" Value="@((context as ScheduleData.AppointmentData).Subject)"></SfTextBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="e-textlabel">Status</td> 
                            <td colspan="4"> 
                                <SfDropDownList ID="EventType" DataSource="@StatusData" Placeholder="Choose status" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).EventType)" HtmlAttributes="@EventType"> 
                                    <DropDownListFieldSettings Value="Id"></DropDownListFieldSettings> 
                                </SfDropDownList> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="e-textlabel">From</td> 
                            <td colspan="4"> 
                                <SfDateTimePicker ID="StartTime" HtmlAttributes="@StartName" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).StartTime.ToUniversalTime())"></SfDateTimePicker> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="e-textlabel">To</td> 
                            <td colspan="4"> 
                                <SfDateTimePicker ID="EndTime" HtmlAttributes="@EndName" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).EndTime.ToUniversalTime())"></SfDateTimePicker> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td colspan="2"> 
                                <SfRecurrenceEditor @ref="RecurrenceEditor" Value="@((context as ScheduleData.AppointmentData).RecurrenceRule)"></SfRecurrenceEditor> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="e-textlabel">Reason</td> 
                            <td colspan="4"> 
                                <textarea id="Description" class="e-field e-input" name="Description" rows="3" cols="50" value="@((context as ScheduleData.AppointmentData).Description)" 
                                          style="width: 100%; height: 60px !important; resize: vertical"></textarea> 
                            </td> 
                        </tr> 
                    </tbody> 
                </table> 
            </EditorTemplate> 
        </ScheduleTemplates> 

    public void OnEditorClose(PopupCloseEventArgs<ScheduleData.AppointmentData> args) 
    { 
        if (args.Data != null && args.Type == PopupType.Editor && RecurrenceEditor != null) 
        { 
            args.Data.RecurrenceRule = RecurrenceEditor.Value != null ? RecurrenceEditor.Value.ToString() : ""; 
        } 
    } 

Q2: It is not possible to change the locale in the DropdownList. 

Kindly add the below highlighted code to overcome for your reported problem and the same can be viewed in the above shared sample. 

Code snippet: 
    private void OnSelected(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string> e) 
    { 
        if (e.IsInteracted) 
        { 
            var culture = (string)e.Value; 
            var uri = new Uri(NavigationManager.Uri) 
                .GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped); 
            var query = $"?culture={Uri.EscapeDataString(culture)}&" + 
                $"redirectUri={Uri.EscapeDataString(uri)}"; 
 
            NavigationManager.NavigateTo("/Culture/SetCulture" + query, forceLoad: true); 
        } 
    } 

Kindly try the above solution and get back to us if you need any further assistance. 
  
Regards, 
Hareesh 



UH Uwe Hein August 6, 2020 06:33 PM UTC

Hi Hareesh,

   thanks for your fast answer. 
It works in the sample but not in my app. I have to figure out, what is different and do some more testing.
The reason for omitting the RecurrenceEditor was:  the customers are not allowed to change the RecurrenceRule. So - is there a possibility to hide or disable the RecurrenceEditor ?

   regards

        Uwe


HB Hareesh Balasubramanian Syncfusion Team August 7, 2020 03:07 PM UTC

Hi Uwe, 

Thanks for the update. 

We have validated your shared query “he customers are not allowed to change the RecurrenceRule. So - is there a possibility to hide or disable the RecurrenceEditor ?” at our end. And it can be achieved by making use of the below CSS property itself. And also we have modified our previously updated sample in that we have hided the Recurrence field of the Scheduler and it can be downloaded from the following link. 

Code snippet: 
    .e-recurrenceeditor { 
        display: none; 
    } 


Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 



UH Uwe Hein August 14, 2020 08:26 AM UTC

Hi Hareesh,

 seems I could fix all my reported issues concerning the edit template in the scheduler. There still is another color issue, I reported in another thread.


Q2: It is not possible to change the locale in the DropdownList. 

I pointed to this, because it is your generated code in the TemplateStudio causing this issue. So maybe you should correct it there, because everybody using your code will run into this problem.

  thanks again

     regards

        Uwe


HB Hareesh Balasubramanian Syncfusion Team August 19, 2020 01:40 PM UTC

Hi Uwe, 

Thanks for being patience. 

We have checked the reported issue and the cause of the problem is value property not updated in client side on initial index bind. Due to time taken for serializing the object , it will update after component rendering. So the previous value is not updated to initial value and change event fired on opening the popup.   

In the provided sample, switch case is used to update the index based on culture value. We have provided value property, so that you can update the value to directly in component. Please find the modified code snippet below. 

Code snippet: 
Previous snippet 
Modified snippet 
<SfDropDownList  TValue="string"   
                                                          TItem="Cultures"   
                                                          DataSource="@CultureList"   
                                                          Width="143px"   
                                                          Index="@cultureIndex"  
                                                          PopupWidth="143px"   
                                                          CssClass="localization-combo">  
        <DropDownListEvents TValue="string" ValueChange="OnSelected"></DropDownListEvents>  
        <DropDownListFieldSettings Value="Code" Text="Text"></DropDownListFieldSettings>  
</SfDropDownList>  


</div>   
@code {  
    private int cultureIndex { get; set; }  

    protected override async Task OnInitializedAsync()  
    {  
        await base.OnInitializedAsync();  
        switch (System.Globalization.CultureInfo.CurrentCulture.Name)  
        {  
            case "en-US":  
                this.cultureIndex = 0;  
                break;  
            case "de":  
                this.cultureIndex = 1;  
                break;  
            case "fr":  
                this.cultureIndex = 2;  
                break;  
            case "ar":  
                this.cultureIndex = 3;  
                break;  
            case "zh":  
                this.cultureIndex = 4;  
                break;  
        }  
          
    }  
<SfDropDownList   TValue="string"   
                                                          TItem="Cultures"   
                                                          DataSource="@CultureList"   
                                                          Width="143px"   
                                                          @bind-Value="@cultureValue"  
                                                          PopupWidth="143px"   
                                                          CssClass="localization-combo">  
        <DropDownListEvents TValue="string" ValueChange="OnSelected"></DropDownListEvents>  
        <DropDownListFieldSettings Value="Code" Text="Text"></DropDownListFieldSettings>  
</SfDropDownList>   
</div>  
<style>  
    .localization-combo {  
        border-radius: 4px;  
        border-color: #B3B3B3;  
        font-family: OpenSans-Regular;  
        font-size: 12px;  
        background-color: #FFFFFF;  
        border-width: 1px;  
        color: #333333;  
    }  
</style>  


@code {  
    private string cultureValue { get; set; }  

    protected override async Task OnInitializedAsync()  
    {  
        await base.OnInitializedAsync();  
        this.cultureValue = System.Globalization.CultureInfo.CurrentCulture.Name;  
    }  

And the same, we have modified our previously updated sample and it can be downloaded from the following link, 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 


Loader.
Up arrow icon