You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Androrion <an...@gmail.com> on 2011/03/30 15:10:30 UTC

Grid dynamically added columns and values

Hi there !

For my first post here, I encounter the following problem :
I've got stats datas to display in a grid, but the stats categories are
dynamic.

For exemple :
Date - Category1 - Category2 - Category 3 - Total
date1 - stat1 - 0 - stat3 - totalDate1
date2 - stat1 - stat2 - 0 - totalDate2

I may have 7 categories for the requested time period, or only 3 for a
different time period.

I created a statBean objet with 3 parameters :
Date date;
Integer total;
List&lt;Integer,Integer&gt; statistics;
statistics contains the categories ids and the associated stat number.

I want to display this object in a grid and add a various number of columns,
depending on how many categories I need.
That's the easy part, however I can't figure out how to tell the grid that
the value has to be retrieved in the 'statistics' parameter of my bean.

I already searched the list for similar problems but only found questions
and no solution :-(

Can someone give me a hand on this ? 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-dynamically-added-columns-and-values-tp4271429p4271429.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid dynamically added columns and values

Posted by Androrion <an...@gmail.com>.
Thanks a lot ! I don't know why it didn't occur to me the first time but now
it works like a charm !
I simply added a constructor to my property conduit and gave it the category
identifier. 
Thank you very much ! :D

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-dynamically-added-columns-and-values-tp4271429p4271666.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid dynamically added columns and values

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 30 Mar 2011 10:56:37 -0300, Androrion <an...@gmail.com> wrote:

> My understanding is that the grid uses myPropertyConduit.get(myStatBean),
> however I can't get the category identifier in this method to access the
> "statistics" list. Am I wrong ?

You need to pass this information yourself to your property conduit  
implementation, most probably through the constructor and storing it in a  
field.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid dynamically added columns and values

Posted by Androrion <an...@gmail.com>.
In fact I already looked in that direction, I tried to create my own
PropertyConduit for the beanModel.
However I couldn't go any further because of the get method of the
propertyConduit.

My understanding is that the grid uses myPropertyConduit.get(myStatBean),
however I can't get the category identifier in this method to access the
"statistics" list. Am I wrong ? 


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Grid-dynamically-added-columns-and-values-tp4271429p4271530.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Grid dynamically added columns and values

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 30 Mar 2011 10:10:30 -0300, Androrion <an...@gmail.com> wrote:

> Hi there !

Hi!

> I already searched the list for similar problems but only found questions
> and no solution :-(

Search for BeanModel, PropertyModel and PropertyConduit. ;-)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org