Iteration and switch statement

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Iteration and switch statement

 and then do a  but need the case statement to be "out a level" if that makes sense.

As I said, right now the template *works* but I'm trying to make it even better.

Thanks to anyone with a suggestion!
Jason Jones
I have a template setup such that I am iterating over an array and generating rows of a table. Depending on the contents of the array, the cell in that row of the table will be either an input box, dropdown, or textarea.

This works fine: I have a
 and within the  are the different elements.

Ideally, however, I'd like the "natural" version of my template to look realistic as well. Right now when I look at the HTML I have a row with all of the different elements mushed together (i.e, a textbox, dropdown, and textarea all in one row together since that's how the HTML flows).

If this were <div> based then I could just wrap stuff in divs and be good to go, but I am trying to keep the HTML fairly clean and table-based. So it's kind of like I am trying to iterate over elements in the
Reply | Threaded
Open this post in threaded view
|

Re: Iteration and switch statement

danielfernandez
Administrator

Hi,

You should have a look at Thymol: http://sourceforge.net/u/jjbenson/wiki/thymol/

It is a JavaScript companion library for Thymeleaf which will allows you to hide/show your conditional sections (th:if, th:unless, etc) when displaying your prototypes statically.

Regards,
Daniel.