Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
325 views
in Technique[技术] by (71.8m points)

java - Can you hide/render tabs in primefaces using wizard

Is it possible to render different tabs using the primeface's p:Wizard? I know you can skip tabs, but I need to have a tab rendered conditionally based on information entered in tab 1 (A). If the user enters in a specific set of check boxes, I need tab C to be rendered and part of the flow, and not shown otherwise.

the skeleton of my xhtml

<p:wizard id="FlowWiz" flowListener="#{myBean.handleFlow}"> 
    <p:tab id="A" title="A">
        stuff
    </p:tab>
    <p:tab id="B" title="B">
        stuff
    </p:tab>
    <p:tab id="C" title="C">
        <ccpath:extraDetailsxml isWizard = "true" />
    </p:tab>
    <p:tab id="D" title="D">
        stuff
    </p:tab>
</p:wizard>

The skeleton of my bean

public class myBean() { 
    private String step = "A";

    public String handleFlow(FlowEvent event){
        isAccepted = false;
    
        if(validatestuff()){
            if(event.getNewStep().equals("B") && showTab()) 
               primeFaces.ajax().update("pathTo:flowWiz");
        
            setStep(event.getNewStep());
        
            return event.getNewStep();
        }else{
            return event.getOldStep();
        }     
    }
}

The data to render tab C will be entered in A, so id like to have tab C rendered when "Next" is clicked. this is what my current xhtml and bean looked like (kinda). any help is appreciated

question from:https://stackoverflow.com/questions/65912470/can-you-hide-render-tabs-in-primefaces-using-wizard

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...