Hotkey / Keyboard Shortcut anomaly

  • 1
  • Problem
  • Updated 4 years ago
  • Solved
  • (Edited)
Hi support, 

I assigned hotkeys / keyboard shortcuts to buttons that navigate from one wizard step to the next. They are working great, however produce a strange anomaly which leads to steps being skipped in certain scenarios.

1) I have "Back" and "Next" Page Title buttons on each step of the wizard (a pair on every wizard page). These are not the native wizard navigation buttons. I used a page title to have more flexibility with my layout.

2) Clicking on "Back" or "Next" runs the snippet posted at the end of the message here. Clicking on them with the mouse produces the expected results without fail all the time, navigating to the actual previous or next tab of the current tab in context

3) Executing the script via the assigned hotkeys (CTRL + leftarrow for "Back" and CTRL + rightarrow for "Next") also results in navigation on each hotkey press

HOWEVER

The "Back" button triggered by hotkey reliably goes to the previous tab of the tab in context.

The "Next" button triggered by hotkey always goes to the next tab of the "highest" wizard step that was executed. So let's say I'm on step 3. I hotkey back to step 2. On step 2, I hotkey forward and land on step 4 (3+1) instead of step 3. If I hotkey back to let's say step 1, hotkey forward then lands me on step 5 (5+1). Clicking on the buttons with the mouse reliably gets me to the correct next / previous step in context.

I made sure this is not a browser cache / local computer problem and tested in in different configurations with the same result. 

Scripts below:

"Next"

var params = arguments[0],            $ = skuid.$;
            var wizard = $('.nx-wizard').data('object'); 
            var currentStep = wizard.steps[wizard.currentstep];
            var next = parseInt(wizard.currentstep.toString()) + 1;  
            var step = currentStep;
            var stepEditor = step.editor;
// Clear our list of messages
stepEditor.clearMessages();
var models = [
    skuid.model.getModel("miiFinanceInvoice"),
    skuid.model.getModel("Task")
];
var messages = [];
$.each(models,function(i,model){
   $.each(model.registeredLists,function(j,list){
       var listMessages = list.validateRequiredFields();
       console.log(listMessages);
       if(listMessages && listMessages.length) {
           $.each(listMessages,function(){
              messages.push(this); 
           });
       }
   });
});
// If we have warning messages, do NOT proceed
if (messages.length) {
    // Have our step's editor handle the messages
    stepEditor.handleMessages(messages);
    console.log("Error Messages Existing");
    return false;
}
// Otherwise proceed!
currentStep.navigate(next);

"Back"

var params = arguments[0],            $ = skuid.$;
            var wizard = $('.nx-wizard').data('object'); 
            var currentStep = wizard.steps[wizard.currentstep];
            var back = parseInt(wizard.currentstep.toString()) - 1;  
            var step = currentStep;
            var stepEditor = step.editor;
// Clear our list of messages
stepEditor.clearMessages();
var models = [
    skuid.model.getModel("miiFinanceInvoice"),
    skuid.model.getModel("Task")
];
var messages = [];
$.each(models,function(i,model){
   $.each(model.registeredLists,function(j,list){
       var listMessages = list.validateRequiredFields();
       console.log(listMessages);
       if(listMessages && listMessages.length) {
           $.each(listMessages,function(){
              messages.push(this); 
           });
       }
   });
});
// If we have warning messages, do NOT proceed
if (messages.length) {
    // Have our step's editor handle the messages
    stepEditor.handleMessages(messages);
    console.log("Error Messages Existing");
    return false;
}
// Otherwise proceed!
currentStep.navigate(back);

Thank you in advance!

Regards, 

Robin
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Hi Robin,

We have recreated this issue and we have fixed it --- the fix should be made available in our next Superbank patch release, 6.8.2.

Zach
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Hi Zach,

Spectacular! You guys are awesome.

Many thanks for the great product and unwavering support,

Robin