Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9266105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:14:29+00:00 2026-06-18T14:14:29+00:00

I use Primefaces 3.5. And try to call js function in onnext handler of

  • 0

I use Primefaces 3.5. And try to call js function in onnext handler of <p:wizard/>.
I want that onnext return on tab on specific tab after validation result ob current tab. My validation function

    function validateManageOtherTournaments(wizard, validationTab, lang) {
                var currentTabId = validationTab;
                if (currentTabId != 'competitionId') {
                    return wizard.next();
                }

                var seasonVal = document.getElementById('manageTournament:name_season_input').value;
                var dateFromVal = document.getElementById('manageTournament:dateFrom_input').value;
                var dateToVal = document.getElementById('manageTournament:dateTo_input').value;
                /*var compNameVal = document.getElementById('manageTournament:title_input').value;*/

                var isValidName = validateFieldsInOtherTournament('manageTournament', ['title'], lang);
                if (isValidName) {
                    if (validRuContentT) {
                        var filledBothDate = (dateFromVal != "" &amp;&amp; dateToVal != "");
                        var isEmptySeason = ("" != String(seasonVal));
                        if ( filledBothDate || isEmptySeason) {
                            return wizard.next();
                        }
                    }
                }
                return "competitionId"; // currentTab
            } 

I use code js wizard. But it still doesn’t work.(

//UPDATED

I try to do something like this

 function validateManageOtherTournaments(wizard, validationTab, lang) {
                /*var wizardElement = document.getElementById('wiz');*/

                var currentTabId = validationTab;
                if (currentTabId != 'competitionId') {
                    var currentStepIndex = wizard.getStepIndex(wizard.getState().currentStep),
                            stepIndexToGo = currentStepIndex + 1;
                    var stepIdToGo = wizard.cfg.steps[stepIndexToGo];
                    return wizard.loadStep(stepIdToGo, stepIndexToGo, false);        // next
                }

                var seasonVal = document.getElementById('manageTournament:name_season_input').value;
                var dateFromVal = document.getElementById('manageTournament:dateFrom_input').value;
                var dateToVal = document.getElementById('manageTournament:dateTo_input').value;
                /*var compNameVal = document.getElementById('manageTournament:title_input').value;*/

                var isValidName = validateFieldsInOtherTournament('manageTournament', ['title'], lang);
                if (isValidName) {
                    if (validRuContentT) {
                        var filledBothDate = (dateFromVal != "" &amp;&amp; dateToVal != "");
                        var isEmptySeason = ("" != String(seasonVal));
                        if ( filledBothDate || isEmptySeason) {
                            var currentStepIndex = wizard.getStepIndex(wizard.getState().currentStep),
                                    stepIndexToGo = currentStepIndex + 1;
                            var stepIdToGo = wizard.cfg.steps[stepIndexToGo];
                            return wizard.loadStep(stepIdToGo, stepIndexToGo, false);         // next
                        }
                    }
                }
                var currentStepIndex = wizard.getStepIndex(this.getState().currentStep),
                stepIndexToGo = currentStepIndex;
                var stepIdToGo = wizard.cfg.steps[stepIndexToGo];
                return wizard.loadStep(stepIdToGo, stepIndexToGo, false);     //competitionId
            }

How I can return in onnext function tab of wizard?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:14:30+00:00Added an answer on June 18, 2026 at 2:14 pm

    I did something like this:

    public String onFlowProcess(FlowEvent event)
    {
      if (!event.getOldStep().equals("competitionId"))
      {
        return event.getNewStep();
      }
      if (validationPassed())
      {
        return event.getNewStep();
      }
      else
      {
        return event.getOldStep();
      }
    }
    
    private boolean validationPassed()
    {
      // do your validation here.
      // return true if validation passed
    }
    

    Then in my wizard: flowListener="#{myBean.onFlowProcess}"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Primefaces to display a wizard pretty much similar to the
I want to ask that sometimes what happen that if I use PrimeFaces Rich
I want to use the primefaces fileupload control in my jboss 7 web application.
I'm using PrimeFaces 3.4.2 and I have to use <p:dataTable> . I want fixe
How to make a primefaces template that includes ajax status for global use. So
I use JSF and PrimeFaces and I try to modify render by changing or
I am new with Primefaces and I try to use a treeTable from Primefaces
I use Hibernate, Spring and JSF (Primefaces) in my project. I want to create
I have this scenario: in the first tab of a primefaces wizard component, I
I want to use Primefaces fileupload, this is my jsf page: <h:form id=uploadForm enctype=multipart/form>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.