You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mika Salminen <mj...@cc.hut.fi> on 2006/10/26 13:35:48 UTC

Tobago Sheet control with dynamic column count

Hi,

I'm trying to make Tobago sheet control to show results of a database
query. The problem I have is that I don't know how to generate columns for
the sheet control dynamically so that I don't have to hard-code the number
of columns in jsp with <tc:column /> -tags. There can only be as many
columns as there are column tags. The number of resultset columns is not
known in advance so there should be a way to generate columns at run-time.
I found that in Tomahawk you can use <t:columns /> -tag, but how can I do
it with Tobago?




Re: Tobago Sheet control with dynamic column count

Posted by Bernd Bohmann <be...@atanion.com>.
Hi Mika,

just added component binding example for tc:sheet

Please look at

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/webapp/solarList2.jsp

http://svn.apache.org/repos/asf/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TestBean.java

One note:

The latest UIData of Tobago has a property columns. The released 
versions has only a columns attribute. Please set it with 
component.getAttributes().put("colums", ...);

Regards

Bernd

Volker Weber wrote:
> Hi Mika,
> 
> you can use the bindig attribute at the tc:sheet tag and create the
> sheet component (and all children components) dynamicaly in your
> application code.
> 
> see
> http://www.mail-archive.com/users@myfaces.apache.org/msg28234.html
> http://www.mail-archive.com/users@myfaces.apache.org/msg28321.html
> 
> Regards
>  Volker
> 
> 
> 
> 2006/10/26, Mika Salminen <mj...@cc.hut.fi>:
>> Hi,
>>
>> I'm trying to make Tobago sheet control to show results of a database
>> query. The problem I have is that I don't know how to generate columns 
>> for
>> the sheet control dynamically so that I don't have to hard-code the 
>> number
>> of columns in jsp with <tc:column /> -tags. There can only be as many
>> columns as there are column tags. The number of resultset columns is not
>> known in advance so there should be a way to generate columns at 
>> run-time.
>> I found that in Tomahawk you can use <t:columns /> -tag, but how can I do
>> it with Tobago?
>>
>>
>>
>>
> 

Re: Tobago Sheet control with dynamic column count

Posted by Volker Weber <we...@googlemail.com>.
Hi Mika,

you can use the bindig attribute at the tc:sheet tag and create the
sheet component (and all children components) dynamicaly in your
application code.

see
http://www.mail-archive.com/users@myfaces.apache.org/msg28234.html
http://www.mail-archive.com/users@myfaces.apache.org/msg28321.html

Regards
  Volker



2006/10/26, Mika Salminen <mj...@cc.hut.fi>:
> Hi,
>
> I'm trying to make Tobago sheet control to show results of a database
> query. The problem I have is that I don't know how to generate columns for
> the sheet control dynamically so that I don't have to hard-code the number
> of columns in jsp with <tc:column /> -tags. There can only be as many
> columns as there are column tags. The number of resultset columns is not
> known in advance so there should be a way to generate columns at run-time.
> I found that in Tomahawk you can use <t:columns /> -tag, but how can I do
> it with Tobago?
>
>
>
>