Wizard Skuid Page Error Issue

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
Hi,

I have a wizard of 3-steps.

STEP1-->STEP2-->STEP3

I have added the below code (in action snippet for button on step1) to show error message when no row selected for a table in STEP1.

var table = $('#CatalogTable'),list,items;var editor = table.data('object').editor;
if (table.length) 
{
   list = table.data('object').list;
   items = list.getSelectedItems();
}

if(!items.length)
{
editor.handleMessages([
        {
            message: 'Please Select an Offer!',
            severity: 'ERROR'
        }    
   ]);
}

else { editor.clearMessages(); }



When I come back to the STEP-1 by clicking on back button from STEP-2, 
still the error message being shown on page.

How could I get rid of this ?


Thanks in advance!
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Can you add a snippet as an action to your back button to clear messages from the editor?
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Hi Raymond,

var table = $('#CatalogTable'),list,items;var editor = table.data('object').editor;
editor.clearMessages();

I added above lines as an action snippet for back button.

It works!!!

I thought there could be some other way (declarative) than having a snippet to clear messages

Thank you!
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Glad it worked!