i use primefaces <p:wizard>
and i registiration step by step.if registiration is end succesfully,wizard's step is first but if i go on for new record or user,Wizard can not add new record.İt is updating previous record/user instead.How do I add new records in series?
Another problem; when it returned to the first step,it can not to reset the field.how can i do that?
its submit button's code;
<p:commandButton immediate="true" value="Submit" update="@parent,wiz1,growl,panel"
actionListener="#{OgrenciKayit.save}" oncomplete="wiz.loadStep (wiz.cfg.steps [0], true)" />
its returned to the first step if wizard submitted.
oncomplete="wiz.loadStep (wiz.cfg.steps [0], true)"
and actionListener
public void save(ActionEvent actionEvent) {
tx = session.beginTransaction();
session.save(ogrenci);
tx.commit();
FacesMessage msg = new FacesMessage("Başarılı", "Hoşgeldin :"
+ ogrenci.getAd());
FacesContext.getCurrentInstance().addMessage(null, msg);
}
Waiting for your ideas.. (additional information i use Jsf 2.2,Tomcat 7.0.50,Hibernate 4.3.5.final,Primefaces,Shiro)
<p:wizard widgetVar="wiz">
<p:tab id="tab0"> ... </p:tab>
<p:tab id="tab1"> ...
<p:commandButton value="Jump to tabId"
actionListener="#{actionTodo.jump}"
oncomplete="PF('wiz').loadStep('tab0', false)" />
</p:tab>
</p:wizard>
This works for me on PrimeFaces 5.0. Note you just need to provide the tabId to loadStep method. Also we should call PF with "PF('widgetVarId')"
.
org.primefaces.context.RequestContext
RequestContext context = RequestContext.getCurrentInstance();
context.reset("myForm");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With