Re: JSP replacement quiz

2009-09-24 Thread Thiago H. de Paula Figueiredo
Em Thu, 24 Sep 2009 14:23:12 -0300, Gunnar Eketrapp escreveu: Hi! Hi! It's not that simple ... The level is displayd as (idx+1) and i dont even have acess to the index or do I? Loop's index parameter is the solution. In your class: @Property private int index; public getLineNumber

Re: JSP replacement quiz

2009-09-24 Thread Kalle Korhonen
Sure you have an access to the index, just like to the element itself. Read the documentation. I'd just do all of that logic in the page class and implement something like getStyleClass(). I don't agree with your "it would be nice if simple loops like this could be achieved in TML" statement. Havi

Re: JSP replacement quiz

2009-09-24 Thread Gunnar Eketrapp
Hi! It's not that simple ... The level is displayd as (idx+1) and i dont even have acess to the index or do I? The class="tdalt" that is rendered on each second line can be solved by methods. But I haven't come up with a solution for the index and index+1 problem. Or am I stupid? Perhaps there

Re: JSP replacement quiz

2009-09-24 Thread kalle.o.korhonen
You can just use Loop component - http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Loop.html Kalle On Thu, Sep 24, 2009 at 5:31 AM, Gunnar Eketrapp wrote: > I am converting jsp that produces a table like ... > > 1      317 > 2      45 > 3      118 >

Re: JSP replacement quiz

2009-09-24 Thread Thiago H. de Paula Figueiredo
Em Thu, 24 Sep 2009 09:31:16 -0300, Gunnar Eketrapp escreveu: I am converting jsp that produces a table like ... 1 317 2 45 3 118 ... i,e. an index plus a count for that index. How should you folks do this? Is there a way with .tml to fix this or do I have to use Grid or wri

JSP replacement quiz

2009-09-24 Thread Gunnar Eketrapp
I am converting jsp that produces a table like ... 1 317 2 45 3 118 ... i,e. an index plus a count for that index. How should you folks do this? Is there a way with .tml to fix this or do I have to use Grid or write a component. JSP code === <% int level=1; %> ><%= level %>