cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oguz Kologlu" <oguz.kolo...@tias.com.au>
Subject RE: JXTemplateGenerator / JX macro bug
Date Fri, 16 Jan 2004 03:45:44 GMT
I've been doing some more testing.

I've created a macro for wt:stlying which outputs the 
styling information similar to the:
<jx:macro name="form-template" targetNamespace="http://apache.org/cocoon/woody/template/1.0">
macro.

I now have:
<wt:widget id="notes">
  <wt:styling type="textarea" rows="4" style="width:100%"/>
</wt:widget>

which _should_ output to the format:

<wi:field id="notes" required="false">
  <wi:styling type="textarea" rows="4" style="width:100%"/>
</wi:field>

but I still und up with:
<wi:field id="notes" required="false"/>
<wi:styling type="textarea" rows="4" style="width:100%"/>

It would appear that:
widget.generateSaxFragment(cocoon.consumer, locale)
(see below for full macro) is not actually processing the 
<wt:styling> macro...

Any ideas?
Oz


-----Original Message-----
From: Oguz Kologlu 
Sent: Friday, 16 January 2004 1:37 PM
To: dev@cocoon.apache.org
Subject: JXTemplateGenerator / JX macro bug


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.

eg:
<wt:widget id="notes">
  <wi:styling type="textarea" rows="4" style="width:100%"/>
</wt:widget>

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?

Thanks,
Oz


See full macro below:
<jx:macro name="widget" \
targetNamespace="http://apache.org/cocoon/woody/template/1.0">  <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>
</jx:macro>


Mime
View raw message