I am trying to pass some parameters in back end with UI include but not its not passing params when I am using expression like value = "#{value}". But I am able to send with params with normal string like value="value".
<ui:include src="index_1.xhtml"> <ui:param name="action1" value="#{o.columnId}" /> <ui:param name="action2" value="#{o.columnType}" /> </ui:include> <br/> But I can pass params with
<ui:include src="index_1.xhtml"> <ui:param name="action1" value="Value1" /> <ui:param name="action2" value="Value2" /> </ui:include> <br/> Index.xhtml
<?xml version="1.0" encoding="UTF-8"?> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> <h:head> <title>TODO supply a title</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> </h:head> <h:body> <h:form> <ui:repeat value="#{myBean.models}" var="o"> <ui:include src="index_1.xhtml"> <ui:param name="action1" value="#{o.columnId}" /> <ui:param name="action2" value="#{o.columnType}" /> </ui:include> <br/> <ui:include src="index_2.xhtml"> <ui:param name="action1" value="#{o.columnId}" /> <ui:param name="action2" value="#{o.columnType}" /> </ui:include><br/> <ui:include src="index_3.xhtml"> <ui:param name="action1" value="#{o.columnId}" /> <ui:param name="action2" value="#{o.columnType}" /> </ui:include><br/> </ui:repeat> <p:commandButton value="Submit" action="#{myBean.submitForm}" /> </h:form> </h:body> </html> index_1.xhtml
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://xmlns.jcp.org/jsf/core"> <h:head> <title>TODO supply a title</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> </h:head> <h:body> <f:event listener="#{myBean.ajaxEventForObjectNo(action1, action2)}" type="preRenderView" /> <h:outputLabel>Single Line Text</h:outputLabel> <p:inputText value="#{myBean.models[myBean.objectNo].columnId}" /> </h:body> </html> Thanks.
ui:repeatis evaluated afterui:include, that's why you don't have the params you're iterating over yet. Replace theui:repeatbyc:forEach.