Is there an event that I can bind to when the step of a wizard is loaded? Or any other way to make javascript execute when a given step is loaded? I have some complex logic where I might need to automatically take the user to a future step if certain data is present. No matter how they get there, I’d like to execute some code whenever they arrive at that step. Instead of duplicating the code in each entry point, it would be nice if there was one place to put it. Example: Entry point 1: conditionally skip step 1 (on page load)
if(task.myField__c){ var wizard = skuid.component.getById('myWizard'); wizard.element.steps.step1.navigate('step2'); alert('welcome to step 2'); //common code }else{ //continue with step1 }
Entry point 2: action button snippet
skuid.snippet.registerSnippet('toStep2',function(args) { var params = arguments[0], step = params.step; step.navigate('step2'); alert('welcome to step 2'); //common code });