You're right, the class/new combination is close tho what I was thinking of! Only, I don't see this in combination with a binding file (yet?). It would be nice to use a sort of catalog, as you mentioned. Creating your widgets, putting them in appropriate catalog files and then including them in your actual definition file (something like the <cinclude:include src="catalog...">). One definition per widget for all your different forms!
Thankz Marc! I'll be trying out that class/new stuff any moment now! Greetz, Jan ----- Original Message ----- From: "Marc Portier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 22, 2003 2:11 PM Subject: Re: Woody referencing/copying widgets? > > > Jan Hoskens wrote: > > > Extension: (maybe this will be more clear?:-) > > > > that helped indeed. > > this sounds like some original idea of building a catalog of > widget-definitions to be reused over all forms > (which I think is more generic then just having reuse inside one > definition file, but not implemented though) > > > but it also sounds like one of the new widgets Timothy is cracking up: > http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson > > (pls check up on the class widget on that page) > > > regards, > -marc= > > > > Actually what I would like to do is something like this: > > > > Definition file: > > <..> > > <wd:repeater id="Key"> > > <wd:widgets> > > <wd:output id="rowid"> > > <wd:label>rowid</wd:label> > > <wd:datatype base="long"> > > <wd:convertor type="formatting"/> > > </wd:datatype> > > </wd:output> > > <wd:output id="type"> > > <wd:label>Type</wd:label> > > <wd:datatype base="string"/> > > </wd:output> > > <wd:output id="code"> > > <wd:label>Code</wd:label> > > <wd:datatype base="string"/> > > </wd:output> > > ... > > </wd:widgets> > > </wd:repeater> > > > > <wd:repeater id="Movie"> > > <wd:widgets> > > <wd:widget refid="Key"/> <!-- Here's the thing!--> > > <...> > > </wd:widgets> > > </wd:repeater> > > </..> > > > > (Same argument for binding files: I set the context correctly and then > > reference to the previous key object. Binding elements/attributes will > > be the same in movie and outside, thus setting my context correctly, or > > because of the fact that I'm referencing from inside the repeater, its > > context is already set, should be enough.) > > > > This definition/binding would be applied to e.g: > > <person> > > <key/> > > <key/> > > <movie> > > <key/> > > <key/> > > </movie> > > <movie> > > ... > > </person> > > > > This one time definition/binding of the Key will result in > > unduplicated code and ergo less faults while changing Key > > elements/attributes. At the moment, I'm duplicating the Key: once inside > > the Movie and once outside. > > > > This is just a thought (trying to make life easier for users;-)! If it's > > crazy to do so, just let me know! > > > > Greetz, > > > > Jan > > > > ----- Original Message ----- > > *From:* Jan Hoskens <mailto:[EMAIL PROTECTED]> > > *To:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > *Sent:* Monday, December 22, 2003 8:49 AM > > *Subject:* Woody referencing/copying widgets? > > > > Hi, > > > > Is there any way to reference/copy a widget that's already > > defined/used? I currently have the following situation: > > > > <person> > > <key> > > <value> > > <type> > > <...> > > </key> > > <...> > > <movie> > > <key> > > <value> > > <type> > > <...> > > </key> > > <...> > > </movie> > > </person> > > > > Notice the keys: the format is the same. So: I want to define one > > key and reuse it whenever I need to. Is this possible? > > > > 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] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
