Jan Hoskens wrote:

Hi,
I'm dealing with the following situation: A directory structure containing a lot of files with the same structure is handled by the same woody definition, binding and template by simply changing the datafile. This file contains an attribute which indicates that it is an original one or a new one created by the user. If it is an original one, only some inputs may happen, but when the user created the file, all may be changed:
<DataFile original="true">
<Name>Josh</Name>
<Cookies>3</Cookies>
</DataFile>
-> show only input field for Cookies
<DataFile original="false">
<Name>Kate</Name>
<Cookies>5</Cookies>
</DataFile>
->this file was created by user, show input field for Cookies AND Name
I'm dynamically generating the filelist and only when reading the file, I know if it's an original one.
I'm thinking about having the woodystylesheet choose the correct form element by testing the attribute 'original=true' (saving that attribute as hidden widget or something alike and then using it in the woodystylesheet).
Are there other/better ways to do this? (e.g. choosing the correct widget by evaluating an attribute/element in datafile instead of changing it by the stylesheet?)

hm, don't know if I get this completely, but your datafile seems to indicate which form to display to the user, right?


here and know I would just develop both cases (possibly sharing pipeline config with some * - {1} mapping) and in the flow just load the DOM, inspect it and based on the /[EMAIL PROTECTED] you select the path to use

hm also sounds like one of the upcomming new widgets 'union' and his companion-binding is a way out for cases like this: find some inspiration about it here: http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson

'fraid the binding isn't working for that widget yet, and we are still discussing how that new stuff would best fit into the current setting...

regards,
-marc=

Anyone having the same situation?
Greetz,
Jan

-- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to