You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Enrique Medina <e....@gmail.com> on 2005/04/05 16:58:01 UTC

x:dataTable and defined variable

Hi,

I'm using the x:dataTable tag from MyFaces, but have noticed that the
paged scoped variable defined within the tag to be able to reference
objects in the data model cannot be referenced from inside the facets.
An example will serve to illustrate this:

	<x:dataTable id="data" var="oferta" border="1"
		value="#{buscarBean.vehiculosDataModel}" headerClass="estilo1"
		preserveDataModel="true" rows="10" renderedIfEmpty="false"
		cellpadding="5" cellspacing="0"
		style="border: thin; border-width: 10px; border-color: gray; width: 100%;">
		<f:facet name="header">
			<x:commandLink action="#{buscarBean.verOfertaAction}"
				immediate="true">
				<x:outputText value="#{oferta.marca.name} #{oferta.modelo}" />
				<h:outputFormat value=" ({0,date,yyyy})"
					rendered="#{oferta.primeraMatriculacion != null}">
					<f:param value="#{oferta.primeraMatriculacion}" />
				</h:outputFormat>
			</x:commandLink>
		</f:facet>

 As you can see from this piece of code, I define "oferta" as being
the object inside the dataTable to reference the data model. But I get
nothing rendered inside the facet. If I use it afterwards within the
columns, obviously it works perfectly.

Is this the expected behaviour? Cannot I reference that variable from
the facets?