I'm new to
JSF. I've just started working on a JSF webapp with lots of page fragements (.jspf). Almost all of our
jsp files are .jspf and are added to tabs with something like this:
This has worked pretty well, but now we've run into a problem. We want multiple tabs to use the same page fragment JSP to provide the same view to a different collection of data. When I do this, I get duplicate component id errors. I assume this is because some of the component IDs are specified in the page fragment JSPs.
I'm not sure how to tackle this problem. I've done some googling and brainstorming and haven't made much progress. Is there a good way to do it? Should we do a major refactoring and get rid of the page fragments in tabs architecture to accomplish this? Any examples on the web of providing the same view on multiple tabs with a different set of data on each tab?
I was thinking of trying this but it seems kind of crazy: When a new HtmlTab is needed, programatically create it. Then grab all the child components off another HtmlTab and clone them and set unique IDs in the clones, and then add them programatically to the new HtmlTab. This seems like a lot of work, and probably would run it to problems.