006/2/3, Geert Bevin <[EMAIL PROTECTED]>:
> thanks for your interesting mail and your kind remarks!
And thank you for the prompt reply!
> * However, using the embed value is a one-shot static configuration,
> to make this more dynamic you can access the embedding element's
> template with the getEmbeddingTemplate() method. This will give you
> full access to that template.
That's almost perfect. Too bad I can't, for example, set a value in an
embedded template using a block from the embeding template. Something
like:
template.setBlock("something",
getEmbeddingTemplate().getBlock("somethingElse"));
This way, the embedded element keep it's template, but the embedding
element has a chance to provide blocks (and maybe values).
> * allow the embed value to easily become the template of the embedded
> element on-the-fly, this makes it easy to mark up lay-outs and
> augment them with behavior.
Maybe not become *the* template of the embedded element, but use the
embeded value as an additional template (from where the element could
fetch blocks and values) would be really, really great. This would be
a nicer version of my first suggestion -- the parent would be able to
provide blocks to the child.
> * support for 'widgets' that don't need to be declared inside the
> site-structure, this still need to be extensively designed and
> investigated. We've talked about it in the past on this list: http://
> thread.gmane.org/gmane.comp.java.rife.user/1104
I think RIFE is almost there. One could see widgets as elements that
only work when embedded inside other elements. That's exactly what
Tapestry does, except that the top-level element has a distinct name
and role: the Page.
As you've probably noticed, my main point here is finding a way for a
parent element to pass blocks to their children. This is very
important when coding widgets -- they often take care of rendering
standard, well-known parts of a page, with parent providing the part
the widget can't figure out by itself. I think that allowing an
embedded element to receive a "body" would solve this problem:
<!--V 'ELEMENT:red-span'-->
<!-- any standard RIFE tags can go here -->
<!--/V-->
A very common and particular case is for a widget to just write it's
provided "body" as part of it's template. To tackle a simple example,
think about an element that just renders a <span
color="red">...</span> around whatever it encloses. It's template
could look like this:
<span color="red"><!--V 'EMBEDDED:BODY'/--></span>
where "EMBEDDED:BODY" is a special value, indicating that at this
point the template provided by the embedding element should be
rendered. Now to get a little trickier, let's think about an element
that renders a <span color="something-customizable">...</span>. It's
template could look like this:
<span color="[!V 'color'/]"><!--V 'text'/--></span>
And the embedding element template could look like this:
<!--V 'ELEMENT:colored-span'-->
<!--BV 'color'-->green<--/BV-->
<!--BV 'text'-->this would go between the span tag<!--/BV-->
<!--/V-->
Well, you probably got my idea by now: setting up a way to embed
elements, and exchange blocks of template between an embedded element
and it's container.
-- Marcus
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users