Carsten Ziegeler wrote:
Sylvain Wallez wrote
Yes, now I see two solutions for this: we could just stream out the
attributes of
the definition (which are strings) or if we need all attributes, stream
out attributes which can be streamed.
I would go for the first solution, anything against this?
Sounds hacky to me...
Really? Why? You define something in the model which you want to access
easily somewhere.
Yeah, but the point is about the "somewhere". Each element in a Cocoon
pipeline is supposed to address a particular concern.
Now over time, reasons emerge for everything to be useful everywhere,
and we end up with a giant mix, where having different stages in a
pipeline no more really make sense, and where each stage produces as
much information as possible for the next one, for the occasional case
where it may be useful, thus impacting the general performance just to
handle these edge cases.
Dumb question: why do you need these attributes in the XSL?
Attributes were meant to allow additional information to be communicated
between the application logic and the various event handlers and
validators attached to widgets, whereas the XSLs are supposed to use the
styling information for their job.
Yes, but what if you need anything else apart from styling? For example
"required" is
passed from the model to the xsls.
I want to pass on information like dependencies between fields, for
example if field A has value 1, then field B is optional and if field A
has value 2 field B is required. I need a generic mechanism here which
just passes this information from the model to the xsls where I can
generate some client javascript.
Well, that looks like business logic to me, and can be handled by
on-change events with Ajax.
Sylvain
--
Sylvain Wallez - http://bluxte.net