The var attribute is only available when the table renderer renders
the rows with the data. the rendered attribute is evaluated before the
rows are rendered. The table renderer requests the rendered value of
each column for the header and footer cells which are rendered without
the var attribute is set.

It will not work when you rename the var attribute. Each attribute of
h:datatable and h:column (including their facets header and footer)
can not be made dependent on the var attribute. Only the additional
defined row-specific attributes of t:column can depend on the var
attribute.

2006/2/4, Michel Goldstein <[EMAIL PROTECTED]>:
> Hi there,
>
> I'm having a problem of the wrong bean being resolved on an h:dataTable...
> I'm building a JSF application to augment a legacy JSP application (in other
> words, there are still a lot of plain-jsp pages still left). In the
> h:dataTable I have the following statement:
>
> <h:dataTable var="attribute"
> value="#{productTypeBrowse.selectedProductType.attributes}">
>     <h:column rendered="#{attribute.hasProperties}">
> ...
>
> I tested it all separately and it worked fine. However, when I integrated
> with the previous system ( i.e., put it into QA and the QA navigated through
> the legacy pages), I got an error message saying that it could not find the
> method "hasProperties" in the bean. When I paid more attention to the error
> message, it was looking for the bean in a legacy data type.
>
> I then went through the legacy code and found the following call:
>
> pageContext.setAttribute( "attribute", oldObject,
> PageContext.SESSION_SCOPE);
>
> And what it looks like is that when it is running, instead of resolving to
> the dataTable-set "local" variable it is resolving to the session object. Is
> this an expected behavior? Is the only way of going around this to rename my
> dataTable variables to something that does not collide with any set session
> variables?
>
> Thank you,
>
> Michel
>


--
Mathias

Reply via email to