Hi Frederic,

actually there's a much more simple solution for that:
processEmbeddedElement(template, "Table", "1", m_td1);
processEmbeddedElement(template, "Table", "2", m_td2);

with:
<p>
Here is a table:
</p>
<r:v name="ELEMENT:+Table:1"/>

<p>
Here is another table:
</p>
<r:v name="ELEMENT:+Table:2"/>

Notice the '+' sign.

This means that the embedded element will only be automatically rendered when the template is printed. The default (without the + sign) renders the embedded element as soon as the template is instantiated.

I think you stumbled into a bug though since it seems that even if you explicitly call processEmbeddedElement afterwards it looks like the new state of the embedded element isn't replacing the old one (the one that resulted from the default render).

Nice example though!

It would be nice to create a new section on the wiki for these. I'll include the nicest ones into the main examples on the RIFE website. Everybody go for it! ;-)

Thanks a lot!

Geert

Instead of the combination of:

 processEmbeddedElement(template, "Table", "1", m_td1);
 processEmbeddedElement(template, "Table", "2", m_td2);

with:

 <p>
 Here is a table:
 </p>
 <r:v name="ELEMENT:Table:1"/>

 <p>
 Here is another table:
 </p>
 <r:v name="ELEMENT:Table:2"/>

I needed:

 processEmbeddedElement(template, "Table", "1", m_td1);
 template.setBlock("table1", "table");

 processEmbeddedElement(template, "Table", "2", m_td2);
 template.setBlock("table2", "table");

with:

 <p>
 Here is a table:
 </p>
 <r:v name="table1"/>

 <p>
 Here is another table:
 </p>
 <r:v name="table2"/>

 <r:b name="table"><r:v name="ELEMENT:Table:"/></r:b>

--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to