cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oguz Kologlu" <>
Subject RE: JXTemplateGenerator / JX macro bug
Date Sun, 18 Jan 2004 04:06:53 GMT

thanks for the info. I need to do some presentation logic 
hence the JXTemplateGenerator.

eg: <jx:if test="${..}>etc..</jx:if>

I've put the wi:styling stuff on the backburner for the moment.
Were you planning on expanding on the macros any time soon?


-----Original Message-----
From: Christopher Oliver []
Sent: Friday, 16 January 2004 5:58 PM
Subject: Re: JXTemplateGenerator / JX macro bug

Yes, you're right. There are some special hacks in 
WoodyTemplateTransformer to insert the styling element inside the 
expansion of the widget element. Although possible, it would be ugly to 
recreate these hacks in a macro. Probably what I would do if I were 
planning to fix this is to not use widget.generateSAXFragment() at all, 
and replace its behavior with equivalent jx macro code.

Why can't you use WoodyTemplateTransformer?



Oguz Kologlu wrote:

>Hi all,
>I'm using the latest 2.1 JXTemplateGenerator (cvs tag 1.30) and the JX Macros 
>Christopher Oliver orignally wrote.
>There appears to be a problem with widgets that contains styling information
>when the jxtemplategenerator processes them.
><wt:widget id="notes">
>  <wi:styling type="textarea" rows="4" style="width:100%"/>
>Will be processed as:
><wi:field id="notes" required="false"/>
><wi:styling type="textarea" rows="4" style="width:100%"/>
>(NOTE: two seperate elements..)
>It would appear that:
>  widget.generateSaxFragment(cocoon.consumer, locale)
>in the macro is not outputing the <wi:styling ..> until
>after it has finished processing <wt:widget ...> which then
>results in the field being output as:
><input name="notes">
>instead of the required:
><texterea name="notes">
>Is there some workaround to this?
>See full macro below:
><jx:macro name="widget" \
>targetNamespace="">  <jx:parameter \
>name="id"/>  <jx:set var="widget" value="${woodyCurrent.getWidget(id)}"/>
>  <jx:choose>
>    <jx:when test="${widget.getSize() != null}"> <!-- repeater -->
>       <jx:set var="lastRow" value="${widget.getSize() - 1}"/>
>       <jx:forEach varStatus="loop" begin="0" end="${lastRow}">
>           <jx:set var="woodyCurrent" value="${widget.getRow(loop.index)}"/>
>           ${row.generateSaxFragment(cocoon.consumer, locale)}
>           <jx:evalBody/>
>       </jx:forEach>
>     </jx:when>
>     <jx:otherwise>
>       ${widget.generateSaxFragment(cocoon.consumer, locale)}
>       <jx:evalBody/>
>     </jx:otherwise>
>  </jx:choose>

View raw message