Go to first wizard tab after submit
Hello! I have a need to navigate to the first tab of the wizard component after submit button on the last tab is pressed. Saw this topic viewtopic.php?f=3&t=14786&p=45048&hilit ... tab#p45048 but don't understand it. Submit button is not like next one, it doesn't file any FlowEvent Or there is a way to pass such event? Thanks for help in advance!!
You could do it with javascript:
Use the widgetVar attribute, this will be used in javascript:
Asumming that you want to reset the wizard after a commandButton action:
The javascript code:
If you dont want to write a javascript function, then you could do it this way:
Use the widgetVar attribute, this will be used in javascript:
Code: Select all
<p:wizard widgetVar="wiz" ...>
Code: Select all
<p:commandButton .... oncomplete="resetWizard()"/>
Code: Select all
<script type="text/javascript">
function resetWizard() {
wiz.loadStep(wiz.cfg.steps[0], true);
}
</script>
Code: Select all
<p:commandButton .... oncomplete="wiz.loadStep(wiz.cfg.steps[0], true)"/>
PrimeFaces 4.0 | Extensions 1.1.0 | GlassFish 4.0 | Mojarra 2.2.4 | NetBeans 7.3.1
I'm trying to reset a component wizard dialog inside but I can not do it. Even using onComplete = "wiz.loadStep (wiz.cfg.steps [0], true)" in my command button. Any help?
Primefaces 5.1
Mojarra 2.2.9
Glassfish 3.1.2
Wildfly 8.1
Ubuntu 14
Netbeans 8.0.1
Mojarra 2.2.9
Glassfish 3.1.2
Wildfly 8.1
Ubuntu 14
Netbeans 8.0.1
I'm trying to reset a component wizard dialog inside but I can not do it. Even using onComplete = "wiz.loadStep (wiz.cfg.steps [0], true)" in my command button. Any help?
Primefaces 5.1
Mojarra 2.2.9
Glassfish 3.1.2
Wildfly 8.1
Ubuntu 14
Netbeans 8.0.1
Mojarra 2.2.9
Glassfish 3.1.2
Wildfly 8.1
Ubuntu 14
Netbeans 8.0.1
if I try this solution my wizard jumps allways to the second step. It doesn't matter if i use
wiz.loadStep (wiz.cfg.steps [0], true);
or
wiz.loadStep (wiz.cfg.steps [1], true);
it's even bader:
If I execute wiz.loadStep (wiz.cfg.steps [0], true) twice the wizard jumps from one wizard step to the other. Same thing i I use the id of the tab wiz.loadStep ('company', true); So it seams to me that this must be a primefaces bug in the javascript. (Of course the tab-id company just exists once)
Any other ideas why?
I use primeface 3.3.1
Edit:
it works only when I add the following:
if(wizard.currentStep != "company"){
wiz.loadStep ('company', true);
}
if I execute wiz.loadStep ('company', true) when the wizard is allready in this step, the wizard jumps to a different location.
wiz.loadStep (wiz.cfg.steps [0], true);
or
wiz.loadStep (wiz.cfg.steps [1], true);
it's even bader:
If I execute wiz.loadStep (wiz.cfg.steps [0], true) twice the wizard jumps from one wizard step to the other. Same thing i I use the id of the tab wiz.loadStep ('company', true); So it seams to me that this must be a primefaces bug in the javascript. (Of course the tab-id company just exists once)
Any other ideas why?
I use primeface 3.3.1
Edit:
it works only when I add the following:
if(wizard.currentStep != "company"){
wiz.loadStep ('company', true);
}
if I execute wiz.loadStep ('company', true) when the wizard is allready in this step, the wizard jumps to a different location.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 28 guests