You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GF <ga...@gmail.com> on 2008/01/07 12:45:40 UTC

[S2] rendering a matrix (like a chessboard)

I have matrix of objects.. somekind like ChessBoardPosition[][]
I want to render it using Struts2.

You can imagine my matrix as a Chessboard..
I use 2 iterators, to iterate over columns and rows, and finally i
want to render the single object inside the matrix, that will be a
empty position of the chessboard. or a busy position with a chess
piece.

Which kind of technique do you suggest to me?

My idea is to use something like:

<s:iterator --rows-- >
<s:iterator --columns-- >
-- render the single chessboard position --
</s:iterator>
</s:iterator>

Is there a way to use Tiles.. and I can create a tiny tile to which I
pass the ChessBoardPosition object and the tile will do the work of
rendering it depending of which kind of piece there is on it?

Or maybe is better to do something different?
Any idea is appreciated.
Thanks!!

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] rendering a matrix (like a chessboard)

Posted by Yayo <ed...@gmail.com>.
create a custom tag for the board rendering ^g^

On Jan 7, 2008 12:45 PM, GF <ga...@gmail.com> wrote:

> I have matrix of objects.. somekind like ChessBoardPosition[][]
> I want to render it using Struts2.
>
> You can imagine my matrix as a Chessboard..
> I use 2 iterators, to iterate over columns and rows, and finally i
> want to render the single object inside the matrix, that will be a
> empty position of the chessboard. or a busy position with a chess
> piece.
>
> Which kind of technique do you suggest to me?
>
> My idea is to use something like:
>
> <s:iterator --rows-- >
> <s:iterator --columns-- >
> -- render the single chessboard position --
> </s:iterator>
> </s:iterator>
>
> Is there a way to use Tiles.. and I can create a tiny tile to which I
> pass the ChessBoardPosition object and the tile will do the work of
> rendering it depending of which kind of piece there is on it?
>
> Or maybe is better to do something different?
> Any idea is appreciated.
> Thanks!!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Sit tibi terra levis"

http://yayocaturas.blogspot.com/