How can I rename the button text (default "step 1" till "step n") of each WizardStep
?.
For the entire Wizard
the text of the finish button can be set by setting the property finishButtonText
. But there is no similar property for the WizardStep
.
There is no robust, proper way of changing the next button text (that I could find).
But here are two workarounds that might help while someone else gives a better answer:
The "next button" is the last control of the content of the current wizard step
myWizardStep.getContent()[lastIndex].setText("new text"); /*note that after the button is pressed, the control will no longer be a part of the WizardStep, and lastIndex won't reference the button's index anymore*/
Another (not great) solution:
The generated id of the button is the id
of the Wizard
(not the WizardStep
) + -nextButton
. So if you have a wizard __xmlview13--myWizard
, the next button will always be __xmlview13--myWizard-nextButton
, which you can get using sap.ui.getCore().byId(nextButtonId)
and then .setText()
, etc.
Both workarounds are just a temporary solution, and the button text will change after being pressed, because you are working with the same instance of Button
.