1
votes

I am using PrimeFaces 5.3 and eventually want to use the onnext attribute of the wizard to hide the Next button using hideNextNav(). However, I am currently just trying to test this functionality by calling the next() method instead. Since I am new to primefaces and jsf in general, I have attempted using various syntax, but all my attempts have rendered the Next button non-functional. When I try alert() instead, it works correctly, showing a message box and proceeding to the next tab.

My error:

jsf error

My xhtml code:

<script>
    function nextf(){
        PF('wizard').next();
    }
</script>
...
<p:wizard widgetVar="wizard" flowListener="#{editController.onFlowProcess}" onnext="nextf();">

Your help would be greatly appreciated.

1
next() call will trigger onnext event. What exactly do you want? Why are you calling next() once more while next() is already being called? (and thus you're basically calling next() in an infinite loop, as evident by the error message and stack trace). - BalusC
lol you may have discovered the issue. Testing - Weasemunk
Go ahead and leave an answer, and I will mark it! I previously had other issues, but didn't understand the call order. Everything works as intended. - Weasemunk

1 Answers

5
votes

Opening the next tab triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. The onnext event function in turn triggers PF('wizard').next() call. The PF('wizard').next() in turn triggers the onnext event. Etcetera.

And then maximum call stack size was exceeded.

You'd better not call PF('wizard').next() during the onnext event.