Tim Holloway wrote:Actually, a dataTable is exactly designed for stuff like this. But you don't need HTML for it. JSF can do the job entirely. Actually, I discourage using raw HTML in JSF for most things - even DIV's, but in this case, raw HTML would make your job much harder.
.....
Tim Holloway wrote:Well, the most direct way would be to add UIComponents to the JSF document tree, but that's a solution of last resort as far as I'm concerned.
A cleaner approach would be to use an h:dataTable or ui:repeat and make the ui:include be a sub-element. The dataTable is the best choice, but it's limited to table-like displays, which is to say stuff that's in rows (and columns). The ui:repeat isn't as tidy overall, but it can be used for non-tabular rendering like when you want to repeat an element horizontally instead of vertically.
If you have a maximum number of repetitions and don't like any of the above solutions, you could also simply code all of them and use their "rendered=" attributes to hide the ones you don't currently want to appear when the page is (re)rendered.
21:37:03,256 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 74) Initializing Mojarra 2.3.9.SP01 for context '/JSF_test_1'
21:37:03,794 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 74) Critical error during deployment: : com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:385)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:341)
.....
21:37:03,794 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 74) MSC000001: Failed to start service jboss.deployment.unit."JSF_test_1.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."JSF_test_1.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
......
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
... 8 more
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:283)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
...
Caused by: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:385)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:341)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTagLibrary(FaceletTaglibConfigProcessor.java:276)
at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.process(FaceletTaglibConfigProcessor.java:232)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:341)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:205)
... 21 more
21:37:03,808 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "JSF_test_1.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"JSF_test_1.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
Caused by: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined"}}
21:37:03,856 INFO [org.jboss.as.server] (ServerService Thread Pool -- 43) WFLYSRV0010: Deployed "JSF_test_1.war" (runtime-name : "JSF_test_1.war")
21:37:03,856 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."JSF_test_1.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: The tag named inputFile from namespace http://xmlns.jcp.org/jsf/html has a null handler-class defined
WFLYCTL0448: 1 additional services are down due to their dependencies being missing or failed
21:37:03,894 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
21:37:03,894 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
21:37:03,894 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
21:37:03,894 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) started (with errors) in 6388ms - Started 694 of 886 services (3 services failed or missing dependencies, 329 services are lazy, passive or on-demand)