Set current displayed tab programmatically in p:wizard

前端 未结 2 1038
执笔经年
执笔经年 2021-01-23 03:43

Is it possible to set current displayed tab programmatically in ?

For example, I want that for two different request to the same page which con

2条回答
  •  执笔经年
    2021-01-23 04:17

    My answer would most probably not meet your complete requirements, but, nonetheless, it may point you towards solution to your problem.

    As far as I know, the PrimeFaces Wizard UIComponent is designed for a workflow of one page. That effectively means that inputs will be handled by a backing beans that is in a view scope.

    This way, making a redirection on a certain step will clear all data inputs, because your view changes and the old one is destroyed.

    Anyway, a means of setting a current tab for display is step attribute of Wizard component. So,

    ...
    

    will force the wizard to show you step which you specified in your bean. You may be able to get it by using, for example, a view parameter, like in

    
    

    But it will make sense if lifetime of your bean is more that for a view, for example, the bean could be put in session scope.

    That said, maybe it is a better idea to do login beforehand. Or, if it is absolutely necessary to do it in step 2 of your wizard, provide for a built-in login functionality in a page itself, or in a popular window?

    Also, programmatically the setting you speak of can be achieved via a binding of component to your backing bean and setting the step value in the backing bean, for example, in a preRenderView event.

提交回复
热议问题