On Apr 12, 2004, at 4:59 PM, Joe Bowers wrote: <snip>
It's acceptable for me to bend, fold, or otherwise mutilate the designer-provided tag to some degree, so something like:
<a href="GUI_GENERATED_CALL(garbage, 'WindowName', 'WindowParams')" nevow:data="{'name' : 'WindowName', 'params' : 'WindowParams'}" nevow:render="dynamicPopup"
Click here for a popup</a>
would be fine- but the literal parameters I need to preserve need to be under the control of the designers and present in the template rather than in the code.
There is an experimental feature in the Nevow codebase that probably not too many people know about. I call them render parameters. They were designed for almost exactly this use, to allow designers to provide parameters to a renderer which will affect how it renders. The syntax is a bit odd and probably still open for discussion, but it is currently: <a nevow:render="dynamicPopup WindowName,WindowParams">Click here</a> The renderer name and arguments are separated by a space; the individual arguments are separated by commas. The arguments would be sent to the render method like so: def render_dynamicPopup(self, name, params): print name, params return "woo" Since you probably also want access to the context and data parameters normally passed to a renderer, you probably want to create and return a closure (nested function) which gets ctx and data: def render_dynamicPopup(self, name, params): def nestedFunction(ctx, data): print name, params, ctx, data # has access to name and params because they are "closed over" return "woo" return nestedFunction This is still a somewhat experimental feature; there is an example of usage in "sandbox/mg/reroot.py". If you try it out, please give us feedback on whether it solves your problem, how useful it is, and whether the syntax or semantics could be improved to make it more useful. dp