Unplanned
Last Updated: 10 Nov 2022 09:01 by ADMIN
Andre
Created on: 17 Jul 2021 14:15
Category: Wizard
Type: Feature Request
10
Visible parameter for the wizard steps

 The disable option is still showing the step and it is not good for me. I have 35 types of transactions and all of them have generic and specific step.

---

ADMIN EDIT

Here is a potential workaround - basic conditional markup can add or remove steps. The key thing is that they will be added to the end of the wizard if they had not been rendered. To handle this, dispose and re-initialize the component, so the step will be rendered at the correct position.

If you have complex steps, you can work around this by creating a collection of descriptor models for the list of steps and create the steps based on that collection, where you can keep the VIsible flag, in a fashion similar to this example for the TabStrip.

<TelerikButton OnClick="@ToggleStep">Toggle attachments step visibility</TelerikButton>

@if (WizardVisible)
{
    <TelerikWizard @bind-Value="@CurrStepIndex" >
        <WizardSteps>
            <WizardStep Label="Personal Details" Icon="user">
                <Content>
                    content here
                </Content>
            </WizardStep>

            @if (AttachmentsStepVisible)
            {
                <WizardStep Label="Attachments" Icon="paperclip">
                    <Content>
                        conditional content here
                    </Content>
                </WizardStep>
            }

            <WizardStep Label="Confirmation" Icon="check">
                <Content>
                    other content here
                </Content>
            </WizardStep>
        </WizardSteps>
    </TelerikWizard>
}


@code {
    bool AttachmentsStepVisible { get; set; }
    bool WizardVisible { get; set; } = true;

    int CurrStepIndex { get; set; }

    async void ToggleStep()
    {
        //dispose the Wizard
        WizardVisible = false;

        // defence against hiding the step when it is the last step, which would cause an exception
        if (AttachmentsStepVisible && CurrStepIndex == 2)
        {
            CurrStepIndex = 1;
        }

        //the actual visibility toggle
        AttachmentsStepVisible = !AttachmentsStepVisible;

        //allow some time for the disposal and toggling the step visibility prior to re-initialization
        await Task.Delay(10);

        //re-initialize the Wizard
        WizardVisible = true;

        StateHasChanged();
    }
}

---

3 comments
ADMIN
Nadezhda Tacheva
Posted on: 10 Nov 2022 09:01

Hi Craig,

I am glad to find out the suggested workaround is useful for your scenario.

The status of the enhancement is currently "Unplanned" which indicates it is not yet scheduled for a specific release. However, a Visibility parameter for the steps will be a useful feature that we will add in a future version of the Wizard component. The easiest way to follow its progress is to subscribe for the item so you will receive status updates.

Considering the current Wizard design, this behavior is expected and this is why there is no bug filed in this regard. In the discussed scenario, steps are dynamically added to the Wizard via conditional rendering during runtime. However, the component is not designed to react to such dynamic changes in its structure. Thus, one should force the Wizard re-rendering so the changes will be accordingly reflected in the view port. Once the Visible parameter is exposed, we will internally handle the component update, so it can react to changes in the visibility of the steps out of the box.

I hope you will find the above information useful. Please let us know if any other questions are raised.

Regards,
Nadezhda Tacheva
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Craig
Posted on: 03 Nov 2022 17:55

Thanks to whoever added the workaround. We have the exact same situation with dynamic steps and re-rendering using TelerikStepper.

If work isn't being done to add this enhancement, is there a bug filed? I assume this isn't expected behavior for the Wizard when re-rendering.

ADMIN
Nadezhda Tacheva
Posted on: 19 Jul 2021 10:24

Hi Andre,

I also consider exposing a Visible parameter for the Wizard steps a very useful feature.  Therefore, I will now update the status of this post to "Unplanned". It indicates that this is a valid feature request that will be scheduled for implementation in future version of the Telerik UI for Blazor.

Since you are the creator of the post, you are subscribed and will receive email notifications when its status changes. This is the best way to keep in track with the progress of the feature. We are prioritizing the feature requests implementation based on the community interest and demand and once we know which release will contain the implementation of this feature, we will update its status in the feedback portal and you will be notified via email right away.

I hope you will find this information and the admin edit suggestion useful. If any further questions appear, please do not hesitate to contact us.

Thank you for choosing Telerik UI for Blazor!

Regards,
Nadezhda Tacheva
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.