Hi David,

there are several possibilities:

1. you pass an object explicitly to an embedded element using http:// rifers.org/docs/api/com/uwyn/rife/engine/ ElementSupport.html#processEmbeddedElement (com.uwyn.rife.template.Template,%20java.lang.String,% 20java.lang.Object) or http://rifers.org/docs/api/com/uwyn/rife/ engine/ElementSupport.html#processEmbeddedElement (com.uwyn.rife.template.Template,%20java.lang.String,% 20java.lang.String,%20java.lang.Object) and http://rifers.org/docs/ api/com/uwyn/rife/engine/ElementSupport.html#getEmbedData()

2. you query an embedding element from within the embedding element when you need data using getEmbeddingElement(), ideally you have some interface that embedding elements implement to make this better structure (see and the NewsProvider interface and NewsEntry element in http://rifers.org/rife_indepth_simple_blog)

3. getEmbedValue() from within the embedded template can be used to retrieve what's inside the embedded element value tag, however it's not dynamic and can only refer to default content, you can however do whatever you want using getEmbeddingTemplate()

4. this is the one I like the less, but you can use setRequestAttribute(String, Object) in the embedding element and retrieve the values in the embedded elements using getRequestAttribute (String)

Hope this help,

Geert

On 27 Jan 2007, at 05:51, David HM Spector wrote:

Is there an obvious way to pass a value to an ELEMENT take inside a template? I see how to get static values out, as in http://rifers.org/wiki/display/RIFE/Embedded +elements#Embeddedelements-3

and use them to get properties as in the label generator, but what if I need to insert a values at run time so that the embedded element can pick it up on the fly and go
do its thing?

For example, if I have an element called NEWSBOX (which is basically a clone of the CMF news item example), how do I pass a value to NEWSBOX inside the HTML template that's using it..? In this case NEWSBOX takes an integer parameter which is the object id in of something the content management framework.

E.g.,:

                   <table>
                        <tr>
<!--V 'ELEMENT:.NEWSBOX'--> <!--V 'cmfid' /--> <!--/V-->
                        </tr>
                        :
                        :

--
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