I'm passing a parameter to a <ui:composite>
page as a solution proposed here. It works perfectly in other cases, but in this one, the parameter passed is always null
. Here's the code:
dados.xhtml -> it's placed at resources/protocolo/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<composite:interface>
<composite:attribute name="protocolo" />
</composite:interface>
<composite:implementation>
<p:panel header="Protocolo #{protocolo.id} | #{protocolo.situacao.descricao}">
<p:panelGrid style="text-align: center; width: 100%;" >
<p:row>
<p:column> Operação </p:column>
<p:column> #{protocolo.operacao.descricao} </p:column>
</p:row>
<p:row>
<p:column> Data entrada </p:column>
<p:column>
<h:outputText value="#{protocolo.dataEntrada}">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:outputText>
</p:column>
</p:row>
<br/>
</p:panelGrid>
</p:panel>
</composite:implementation>
</html>
Here's where i call this composite page:
#{protocolo.id}
<protocolo:dados protocolo="#{protocolo}"/>
Calling protocolo.id
returns the correct id for the entity, but inside the composite, it returns null
. I'm using other composite pages inside this xhtml and it's working perfectly.
Anyone can help?