Originally posted by Patrick Ferguson:
Thanks Hans,
I'm also posting this in the Java forum. But I tried what you said about putting the included page in <f:subview> tags, and it does something really odd. The included page is a menu page, it has some DIV tag stuff in it where it defines the links and to put my links in there I use the <h:commandlink> tag. If I used the <f:view> and bring up just that page by itself (not included in another page), it works fine. And if I include it in a page with no <f:view> tags, it works fine. But when I include it in a page with <f:view> tags and <f:subview> tags in the included page, it's like it pulls the JSF components out of the DIV tags in the included page. I don't know if this is a bug or just something I'm doing incorrectly, but I don't understand why JSF needed to make page includes so difficult.
Anyway, any opinion on this would be greatly appreciated.
That's what I meant with "there are many other issues regarding dynamic includes". You need to wrap all non-JSF elements within <f:verbatim> elements in the included page as well.
But again, do you really have to use a dynamic include? A static include (i.e., <%@ include file="..." %>
doesn't have all these issues; you just include the file without adding any wrapping elements. Dynamic includes should be used (in JSF) only when you don't know the name of the file at design/compile time to avoid all this extra complexity.