I did not come up with the right solution (updating the AJAX tabs of the wizard prevents the iframe of the Recaptcha control from reloading), but I created a simple way:
- position
<p:captcha> outside <p:wizard> - position the captcha iframe absolutely, so it moves inside the wizard
- hide it with CSS and
- display the captcha inside the
flowListener method on the corresponding wizard tab:
eg.
public String onFlowProcess(FlowEvent event) { RequestContext context = RequestContext.getCurrentInstance(); if ("confirm".equals(event.getNewStep())) { context.execute("jQuery(document.getElementById('register:captchaDiv')).show()"); } else { context.execute("jQuery(document.getElementById('register:captchaDiv')).hide()"); } return event.getNewStep(); }
source share