cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <>
Subject Re: [RT] Attribute Rendering and CForms Convertors
Date Mon, 08 Nov 2004 13:10:56 GMT
Joerg Heinicke wrote:
> But why introducing dependencies into the view and not externally? How 
> do you want to ensure consistent view over all templates or even over 
> different applications in a software product line?
Imagine you have a bunch of java.util.Calendar properties all around your 
JavaBeans. Now in most of the views you want to render them according to a 
specific pattern.

Now there are some special cases when you want those dates to get additional 
styling as long as the date value meets specific criteria so there are two 
things that decide if the date should be additionaly emphasized:
- view template (some views may render the same property in plain format, some 
  may want if emphasized)
- date value (only the values that meet some criteria are being pretty printed)

I know that this may bring inconsistency among views but as long as only 
developer knows if the property should be styled or not there is no other way.

I like Daniels comparison to a CSS class attribute.

Something like ${bean.startDate} or <jx:out value="${bean.startDate}"/> would 
use default renderer. Something like ${bean.startDate?class=emph} <jx:out 
value="${bean.startDate}" styling="emph"/> would point that other convertor is 

If you need your view to be reusable you can do it and choose convertors. The 
only thing is that your convertor should generate some markup that will be 
transformed later and not HTML/WML or anything specific.

Leszek Gawron                            
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                    
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

View raw message