I saw that this question asked a lot, but no one received the proper answer, so I decided to ask again. Therefore, if I have this: if I'm in A.xhtml and I
<ui:include src="B.xhtml"> <ui:param name="formId" value="awesome Id"/> </ui:include>
so in B.xhtml i can do this
<h:outputText value="#{formId}"/>
when I run A.xhtml , I will see awesome Id to print on the screen. However, how do I access the formId value in the bean base. I look inside FacesContext.getCurrentInstance().getAttributes() and FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap() , and I just can't find it. To go a little further, I try:
Inside B.xhtml now have
<h:inputHidden id="hiddenFormId" value="#{formId}"/> <h:outputText value="#{formId}"/>
The idea is that I can access the formId value in RequestParameterMap under the key hiddenFormId . But now, if I have:
<h:form id="myForm"> <ui:include src="B.xhtml"> <ui:param name="formId" value="awesome Id"/> </ui:include> <a4j:commandButton render="myForm" value="My Button"/> </h:form>
then I would get this erro if I look into the POST request (when inside chrome or ff debug mode)
<partial-response><error><error-name>class javax.faces.component.UpdateModelException</error-name><error-message><![CDATA[/B.xhtml @9,61 value="${formId}": /index.xhtml @27,61 value="awesome Id": Illegal Syntax for Set Operation]]></error-message></error></partial-response>
so How do I access the ui: param value in a managed bean?
source share