openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.m.Wizard : next button still displayed although showNextButton set to false

Open jfhensens opened this issue 7 years ago • 4 comments

OpenUI5 version: 1.61.1

Browser/version (+device/version): Internet Explorer 11.407.17134.0 laptop/Windows 10 Version 1803 (OS Build 17134.407)

Any other tested browsers/devices(OK/FAIL): Google Chrome 71.0.3578.98 (FAIL)

URL (minimal example if possible): https://github.com/jfhensens/sapui5-wizard.git

Open index.html with a local Server

User/password (if required and possible - do not post any confidential information here): N/A

Steps to reproduce the problem: see ./view/Home.view.xml : showNextButton="false"

  1. Launch the app
  2. Step 1 : Wizard next button ('Step 2') is displayed although showNextButton is set to false
  3. Click on the 'Next' button (see footer) or the Wizard next button ('Step 2')
  4. Step 2 : Wizard next button ('Step 3') is well hidden

What is the expected result? We expect the Wizard next button to be hidden the whole time, because we would like to use a separate button in the footer which would allow the user to go to the next step.

What happens instead? Although the showNextButton is set to false, the Wizard next button is still displayed on the first step (and not on the others!).

Any other information? (attach screenshot if possible)

image image

jfhensens avatar Jan 07 '19 14:01 jfhensens

Hello @jfhensens , Thank you for sharing this finding. I've created an internal incident 1870560218 . The status of the issue will be updated here in GitHub. Regards, Filip

fifoosid avatar Jan 08 '19 12:01 fifoosid

Hi @fifoosid,

Maybe that will help to narrow down the issue :

When I set a breakpoint in the Controller.prototype.onAfterRendering() method, the next button is properly hidden from the first step :

image

Thanks to WizardStep.prototype._activate() which set the 'visible' property of the next button to false according to the showNextButton property of the wizard :

this._oNextButton.setVisible(parent.getShowNextButton());

Unfortunately, Wizard.prototype.discardProgress() method (called by Wizard.prototype._activateAllPreceedingSteps() at the end of Wizard.prototype.onAfterRendering() ), resets the next button visibility to true (the last step is at this time the first step) :

lastStep._oNextButton.setVisible(true);

May I suggest to use instead :

lastStep._oNextButton.setVisible(this.getShowNextButton());

The other steps have their next button visibility set to false by Wizard.prototype._handleNextButtonPress() method and possibly the visibility is reset to true by the WizardStep.prototype._activate() method.

jfhensens avatar Jan 09 '19 12:01 jfhensens

Meanwhile I use the following workaround:

Controller.prototype.onAfterRendering = function () { sap.ui.getCore().byId(this._oWizard.getCurrentStep()).getAggregation("_nextButton").setVisible(this._oWizard.getShowNextButton()); }

jfhensens avatar Jan 09 '19 13:01 jfhensens

Hi @fifoosid

I just wanted to add that I was having the same issue. @jfhensens reported the issue for 1.61.1, but I have been experiencing this issue since version 1.56.12:

image

image

Regards Stef

stefvanw avatar Jan 22 '19 08:01 stefvanw