私はPrimefaces 3.5を使用しています。の onnext ハンドラで js 関数を呼び出してみてください<p:wizard/>
。検証結果が現在のタブになった後、特定のタブのタブに次の戻りが必要です。私の検証機能
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 != "" && dateToVal != "");
var isEmptySeason = ("" != String(seasonVal));
if ( filledBothDate || isEmptySeason) {
return wizard.next();
}
}
}
return "competitionId"; // currentTab
}
コードjs ウィザードを使用します。しかし、それでもうまくいきません。(
//更新しました
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 != "" && 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
}
ウィザードの onnext 関数タブに戻るにはどうすればよいですか?