-
1. Re: Dynamic rich:tabPanel cannot switch tabs
bleathem Nov 29, 2011 4:30 PM (in response to sbalmos1)Possibly related to RF-11054?
-
2. Re: Dynamic rich:tabPanel cannot switch tabs
sbalmos1 Nov 29, 2011 4:46 PM (in response to bleathem)I don't think so. The frustrating thing is that a new test page, structurally the same, works. The only difference I can think of is the forEach, where I have #{evalBean.categories}, is really more like #{evalBean.selfEvaluation.template.categories}, where selfEvaluation is a Hibernate entity that is null at the first page load, but then is loaded in the ajax menu onChange listener. I'm trying to do some testing to see if there's any difference there. But it's frustrating that a new page that is effectively the same structure, even in the backing bean, works.
-
3. Re: Dynamic rich:tabPanel cannot switch tabs
sbalmos1 Nov 29, 2011 5:13 PM (in response to sbalmos1)I've got it, although I can't really explain it. The issue is because the first time the page is rendered, #{evalBean.selfEvaluation} is null. The selectOneMenu effectively is where you're selecting an evaluation to load. So, the first time the page is rendered, there are no tabs that end up in the tabPanel component tree. Something about that causes *something* to not bind correctly in JSF's jQuery, such that the next time around the page is partially rendered, and the tabPanel renders the tabs, you get the Javascript error.
My "fix" is to force a tab to always be present in the component tree. I added a <rich:tab rendered="false"/> at the top of my tabPanel, before the forEach. This forces a tab to be added to the tree, and fixes whatever is going on with JSF's jQuery. Thus, when the page is partially re-rendered due to the selectOneMenu ajax onChange handler, everything is kosher, and I can now switch between tabs.
If you went back to my test page and code, and made it such that #{evalBean.categories} is initially null, but then is populated with a collection of categories in the changeEvalYear method, for example, you should be able to reproduce the issue.