Hi Steven,
I think it's better to leave it as is since the processElement method
is actually the element that processes the tags in the template that
it knows about. Doing it the other way 'round would mean that the
template gets tied to the element, or that a totally new concept of
template processors needs to be introduced.
Take care,
Geert
On 20 Aug 2006, at 19:56, Steven Grimm wrote:
Geert Bevin wrote:
Note that by using getBlock everything is evaluated, even the
placeholders that are filled in with the state information for the
exits and the submissions. There's another method however,
getDefferedBlock, that gives you all the individual content snippets.
What do you think of the idea of adding a convenience method,
something like getRenderedBlock(), that does the "process a clone
of the template" thing? I kind of expected there to be a method to
do that already and was a bit surprised when getBlock() didn't,
especially since the Javadoc sort of implies it will (or at least,
that's how I read it.)
In this case I really did want everything fully filled in,
placeholders included; I was actually transforming the block into a
JavaScript string to assign to a variable so I could do something like
var text = <r:v name="renderedBlock">null</r:v>;
...
document.getElementById("foo").innerHTML = text;
Since the JavaScript transformation involved munging the contents
of the block, e.g. putting backslashes in front of all the double
quotes, I needed the fully rendered string rather than some
intermediate form that would then be further processed by the
template engine.
Later on, should it become commonly used, this getRenderedBlock()
method could be optimized to only do the processing needed to
render the particular block in question. But for a first cut it can
just do the clone-and-process thing I'm doing.
-Steve
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users
--
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