Pass contexts from parsing too renderers

Nov 10, 2010 at 7:58 PM


Currently I trying to prototype an wiki Forms type solution that allows input types to be defined e.g.

{input:type=textbox, value=src:#mydatasource.title}

Then also the bindings such as data sources e.g.

{datasource:id=mydatasource,provider=sql,query=select * from product where id = 1}

and so on.

So my question is how would I go about using the current mechanism (extension points) or implement my own to pass the results of the datasource element (as shown above) to the input element e.g passing some sort of context from the parsing stage to the rendering stages?

After taking a quick glance at the wikiPlex code, 'Scope' Augmenters are the closets to the parsing stage as far as I can see.

Thanks in advance

Nov 12, 2010 at 3:07 PM

You're right, there is no current way of passing "context" around, as it wasn't designed in this manner. What about the hooking into the ScopeRendered event of a Formatter and start capturing the scope / content. This would allow you back-reference any previously rendered scopes. The downside, is that you'd still need to have renderers that were made aware of this common "context". While not exactly clean, it would get you what you'd need with the only downside of data sources needing to be defined first.