开发者

JSF Primefaces:redirect to specific page on p:tab click

开发者 https://www.devze.com 2023-04-07 17:23 出处:网络
I would like to utilize p:tabView for horizontal site menu. When tab is clicked,that user should be redirected in non-ajax style to 开发者_JAVA技巧the specific page.

I would like to utilize p:tabView for horizontal site menu.

When tab is clicked,that user should be redirected in non-ajax style to 开发者_JAVA技巧the specific page.

Is it possible to inject to each tab (e.g. inside p:tab tag) href link ?

Or there is already some alternative to it?


You could put the p:tabView in a template and set the activeIndex property according to the view ID of the current page. It's an ugly hack, but certainly do-able. I did something similar, using a p:menu on the left for navigation in the control panel section of my site.


Primefaces 3.4 now has a p:tabMenu component that may be of use. You will have to manage the active tab manually since this is an undeveloped feature.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号