complex components

Christian Sell <[email protected]>
Newsgroups gmane.comp.java.tapestry.devel
Message-ID <[email protected]>
Hello,

Being a newbie to Tapestry I chose to get my feet wet by implementing a 
little, however reasonably complex component - a calendar which should 
be fully localized and provide a way to move forward and backward 
monthwise, etc. I already have it implemented in struts/tiles, and 
wanted to see how Tapestry fares.

As a first resume, I must say that Tapestry has a rather steep learning 
curve - mostly caused by the multiple files one has to handle for each 
and every little item (like implementing a foreach loop or a conditional 
branch). Tiles tags are  definitely simpler to handle - and scripting a 
JSP (or Velocity) is the easiest.

To some extent I can see this is due to the complex logic involved in 
the problem. The calendar cannot be layed out statically in HTML, with 
individual items replaced by business logic results - it requires a 
nested loop with conditionals inside. Expressing this type of logic in a 
template language is simply a pain (after all, this is what we have 
programming languages for).
Doing this in a html template language like Tapestry has almost only 
drawbacks - the HTML becomes completely unmaintainable, both for humans 
and for design tools, and runtime efficiency is also questionable.

OK, after ranting, heres my immediate questions:

1. Is there a recommendation for situations as the above? Is there a way 
to directly write parts of the component to the response stream from a 
Java method when the logic becomes too complex?

2. I need to also dynamically determine some tag attributes (i.e., 
"class=" style attributes). In a JSP, I can write something like <td 
class="<%=byBean.getStyle()%>">. How is this done with tapestry?

thanks,
Christian Sell



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.