Search Results

Search found 1 results on 1 pages for 'happycoder'.

Page 1/1 | 1 

  • How to include and evaluate xhtml content represented as a String into a page using JSF?

    - by happycoder
    Hi! Im using JSF 1.2 and need to include xhtml content represented as a String in a bean. So, how can I get the content from a bean in xhtml but represented as a String and render it on the page? Here is an example: myPage.xhml ... xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" ... <h:panelGrid> <a4j:outputPanel ajaxRendered="true"> <ui:include src="#{myBean.someContent}" /> <!-- this doesnt work! --> </a4j:outputPanel> </h:panelGrid> ... MyBean.java ... class MyBean ... { private String someContent = "<h:panelGrid><h:outputText value=\"Name:\"/><h:inputText value=\"#{anotherBean.name}\" /></h:panelGrid>"; public String getSomeContent() { return someContent; } public void setSomeContent(String someContent) { this.someContent = someContent; } } i.e. in myPage.xhtml I want to read the someContent variable and include the content before page evaluation. The ui:include-tag nor the h:outputText escape="false" seems to work. /happycoder

    Read the article

1