You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by octoberdan <da...@october5th.net> on 2006/03/20 17:20:01 UTC

No variables in t:column header facets! Bug?

The header will be blank if I do the following
[code]
<t:dataTable id="projectsDataTable" var="project"
value="#{projectBacker.projects}">
	<t:column id="projectNameColumn">
		<f:facet name="header"><h:outputText value="#{project.status}"/></f:facet>
		<h:outputText value="#{project.status}"/>
	</t:column>
...
[/code]

Is there an obvious reason? All of the projects definitely have a status.

Thanks in advance
- Octoberdan
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496365
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
How can I do as I described? Does my  other recent post  have the same
answer?
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496786
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Andrew Robinson <an...@gmail.com>.
The header is printed before there is an active row. In your text, you
are trying to print the status property of the GLOBAL variable
'project' since there is no 'project' variable in the data table yet.

<thead>
...
</thead>

<tbody>
row iteration starts
</tbody>

There is no "project" when <t:column><f:facet name="header"/> is rendered.

On 3/20/06, octoberdan <da...@october5th.net> wrote:
>
> The header will be blank if I do the following
> [code]
> <t:dataTable id="projectsDataTable" var="project"
> value="#{projectBacker.projects}">
>         <t:column id="projectNameColumn">
>                 <f:facet name="header"><h:outputText value="#{project.status}"/></f:facet>
>                 <h:outputText value="#{project.status}"/>
>         </t:column>
> ...
> [/code]
>
> Is there an obvious reason? All of the projects definitely have a status.
>
> Thanks in advance
> - Octoberdan
> --
> View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496365
> Sent from the MyFaces - Users forum at Nabble.com.
>
>

Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
Thank you for the help! This problem has been bugging me for a long time.
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3499665
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Andrew Robinson <an...@gmail.com>.
You can also use:

<t:dataTable value="#{bean.data}"/>

where data in this case is an instance of "javax.faces.model.DataModel"

-Andrew

On 3/20/06, Andrew Robinson <an...@gmail.com> wrote:
> I actually haven't done it. Here is a start:
>
> <t:dataTable binding="#{bean.data}" />
>
> where "data" is a property that returns an instance of
> "javax.faces.component.UIData".
>
> Then you would just build this UIData component programatically in
> your backing bean.
>
> Searching for posts and/or tutorials should help more.
>
> Good luck,
> -Andrew
>
>
>
> On 3/20/06, octoberdan <da...@october5th.net> wrote:
> >
> > >If you are building a dataTable as a grid with dynamic columns, then
> > >using the binding to a dynamic datamodel is probably what you are
> > >looking for.
> > Sounds interesting... How would I go about implementing that?
> > --
> > View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3498912
> > Sent from the MyFaces - Users forum at Nabble.com.
> >
> >
>

Re: No variables in t:column header facets! Bug?

Posted by Mike Kienenberger <mk...@gmail.com>.
On 3/20/06, octoberdan <da...@october5th.net> wrote:
> Great! Thank you all for the  help. Any last pointers [on t:columns]?

Just remember that UIData subclasses all use
getRowData()/getRowIndex() and this is still true for UIColumns.

So to get the current column, you'd still use UIColumns.getRowData().

Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
Great! Thank you all for the  help. Any last pointers?


Mike Kienenberger wrote:
> 
> UIColumns is basically a UIData "turned sideways"
> 
> So you have a data model for your rows, and then you have a second
> data model for each of your columns.
> 
> crossDataTable.jsp in myfaces-example-simple gives an example of using it.
> 
> "Live" online demo is here -- lets you add columns each submit.
> 
> http://www.irian.at/myfaces/crossDataTable.jsf
> 
> On 3/20/06, Andrew Robinson <an...@gmail.com> wrote:
>> I think it would be something like:
>>
>> UIData data = new UIData();
>> UIColumn col = new UIColumn();
>> data.getChildren().add(col);
>> etc.
>>
>> You are basically building the component tree by hand.
>>
>> I think tomahawk has a "columns" item too ("UIColumns") that may be less
>> work.
>>
>> Has anyone else done this to provide more knowledge than me?
>>
>> Thanks,
>> Andrew
>>
>> On 3/20/06, octoberdan <da...@october5th.net> wrote:
>> >
>> > > <t:dataTable binding="#{bean.data}" />
>> >
>> > > where "data" is a property that returns an instance of
>> > > "javax.faces.component.UIData".
>> >
>> > > Then you would just build this UIData component programatically in
>> > > your backing bean.
>> >
>> > Looking over the classes methods there doesn't seem to be any able to
>> add
>> > columns...
>> >
>> > > Searching for posts and/or tutorials should help more.
>> > I tried looking for a relavent example but can't seem to find one... do
>> you
>> > know of any by chance?
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3499883
>> > Sent from the MyFaces - Users forum at Nabble.com.
>> >
>> >
>>
> 
> 
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3500891
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Mike Kienenberger <mk...@gmail.com>.
UIColumns is basically a UIData "turned sideways"

So you have a data model for your rows, and then you have a second
data model for each of your columns.

crossDataTable.jsp in myfaces-example-simple gives an example of using it.

"Live" online demo is here -- lets you add columns each submit.

http://www.irian.at/myfaces/crossDataTable.jsf

On 3/20/06, Andrew Robinson <an...@gmail.com> wrote:
> I think it would be something like:
>
> UIData data = new UIData();
> UIColumn col = new UIColumn();
> data.getChildren().add(col);
> etc.
>
> You are basically building the component tree by hand.
>
> I think tomahawk has a "columns" item too ("UIColumns") that may be less work.
>
> Has anyone else done this to provide more knowledge than me?
>
> Thanks,
> Andrew
>
> On 3/20/06, octoberdan <da...@october5th.net> wrote:
> >
> > > <t:dataTable binding="#{bean.data}" />
> >
> > > where "data" is a property that returns an instance of
> > > "javax.faces.component.UIData".
> >
> > > Then you would just build this UIData component programatically in
> > > your backing bean.
> >
> > Looking over the classes methods there doesn't seem to be any able to add
> > columns...
> >
> > > Searching for posts and/or tutorials should help more.
> > I tried looking for a relavent example but can't seem to find one... do you
> > know of any by chance?
> >
> > --
> > View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3499883
> > Sent from the MyFaces - Users forum at Nabble.com.
> >
> >
>

Re: No variables in t:column header facets! Bug?

Posted by Andrew Robinson <an...@gmail.com>.
I think it would be something like:

UIData data = new UIData();
UIColumn col = new UIColumn();
data.getChildren().add(col);
etc.

You are basically building the component tree by hand.

I think tomahawk has a "columns" item too ("UIColumns") that may be less work.

Has anyone else done this to provide more knowledge than me?

Thanks,
Andrew

On 3/20/06, octoberdan <da...@october5th.net> wrote:
>
> > <t:dataTable binding="#{bean.data}" />
>
> > where "data" is a property that returns an instance of
> > "javax.faces.component.UIData".
>
> > Then you would just build this UIData component programatically in
> > your backing bean.
>
> Looking over the classes methods there doesn't seem to be any able to add
> columns...
>
> > Searching for posts and/or tutorials should help more.
> I tried looking for a relavent example but can't seem to find one... do you
> know of any by chance?
>
> --
> View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3499883
> Sent from the MyFaces - Users forum at Nabble.com.
>
>

Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
> <t:dataTable binding="#{bean.data}" />

> where "data" is a property that returns an instance of
> "javax.faces.component.UIData".

> Then you would just build this UIData component programatically in
> your backing bean.

Looking over the classes methods there doesn't seem to be any able to add
columns...

> Searching for posts and/or tutorials should help more.
I tried looking for a relavent example but can't seem to find one... do you
know of any by chance?

--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3499883
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Andrew Robinson <an...@gmail.com>.
I actually haven't done it. Here is a start:

<t:dataTable binding="#{bean.data}" />

where "data" is a property that returns an instance of
"javax.faces.component.UIData".

Then you would just build this UIData component programatically in
your backing bean.

Searching for posts and/or tutorials should help more.

Good luck,
-Andrew



On 3/20/06, octoberdan <da...@october5th.net> wrote:
>
> >If you are building a dataTable as a grid with dynamic columns, then
> >using the binding to a dynamic datamodel is probably what you are
> >looking for.
> Sounds interesting... How would I go about implementing that?
> --
> View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3498912
> Sent from the MyFaces - Users forum at Nabble.com.
>
>

Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
>If you are building a dataTable as a grid with dynamic columns, then
>using the binding to a dynamic datamodel is probably what you are
>looking for. 
Sounds interesting... How would I go about implementing that?
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3498912
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Andrew Robinson <an...@gmail.com>.
If you are building a dataTable as a grid with dynamic columns, then
using the binding to a dynamic datamodel is probably what you are
looking for.

On 3/20/06, octoberdan <da...@october5th.net> wrote:
>
> I want a column with the shortName of each developer in the list of
> developers
> --
> View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496897
> Sent from the MyFaces - Users forum at Nabble.com.
>
>

Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
I want a column with the shortName of each developer in the list of
developers
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496897
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by octoberdan <da...@october5th.net>.
>>From which project (row) should the header value taken? 
Well, I'm really trying to do this with t:colomns, but I was having some
problems with that so I used this as an example.
--
View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496815
Sent from the MyFaces - Users forum at Nabble.com.


Re: No variables in t:column header facets! Bug?

Posted by Volker Weber <us...@weber-oldenburg.de>.
Hi,

you can't access the dataTables 'var' object in headers or footers!

octoberdan wrote:
> The header will be blank if I do the following
> [code]
> <t:dataTable id="projectsDataTable" var="project"
> value="#{projectBacker.projects}">
> 	<t:column id="projectNameColumn">
> 		<f:facet name="header"><h:outputText value="#{project.status}"/></f:facet>
> 		<h:outputText value="#{project.status}"/>
> 	</t:column>
> ...
> [/code]
> 
> Is there an obvious reason? All of the projects definitely have a status.

>From which project (row) should the header value taken?

> 
> Thanks in advance
> - Octoberdan
> --
> View this message in context: http://www.nabble.com/No-variables-in-t%3Acolumn-header-facets%21-Bug--t1312124.html#a3496365
> Sent from the MyFaces - Users forum at Nabble.com.
> 



Regards,
  Volker

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.