Re: Footnote-Support
Hi again, for those who might be interessted I just wanted to let you know that I now have a working footnote support implementation. The details can be found here http://sanityresort.blogspot.com/2011/09/adding-footnote-support-to-wicket.html (another chance for shameless blog advertising ;-)). Thanks to Dan for his suggestions, though I decided to stick with my initial behavior approach. Mainly because I did not want to create a component subclass but instead enable all components with a string model object to use footnotes. I'm not sure if what I did is very wickety but at least for me it works pretty well and seems rather flexibel. Here a short summary of the features: - programmatically add a footnote to a component - programmatically process the descriptions for programmatically added components - declaratively add labels with footnotes to a markup container - declaratively add label with footnote descriptions for declaratively added footnotes - declaratively add label with footnote descriptions for programmatically added footnotes - use text or images as footnotes - use separate style definitions for each footnote and description - use freely defined wrapping tags for declaratively added footnote descriptions Any kind of feedback is as always very welcome :-) Cheers, Chris The Sanity Resort http://sanityresort.blogspot.com/ Am 19.09.2011 16:41, schrieb Dan Retzlaff: I see now. Forget the behavior approach. :) How about keeping a ListString of footnotes in the page's metadata (i.e. getPage().setMetaData(FOOTNOTES))? Create (1) a Label-like component which, in its onInitialize(), adds its contents to the list and saves the new index to be rendered as the footnote annotation, and (2) a FeedbackPanel-like component which renders the footnote content as an ordered list. You may also be able to put the footnotes into the Session's feedback data as Martin suggests, but I'm not sure how the footnote annotation and footnote content would be differentiated. On Mon, Sep 19, 2011 at 1:15 AM, Christian Huberhub...@butterbrot.orgwrote: Hi Dan, thanks for your answer. To be a bit more clear about what I want, I would like (spoken simplified) to add a footenote to a label like Some textsup1/sup and automatically have the footbnote text appear at the bottom of the corresponding page. Right now I have a Label subclass to do this (and a bit more) but am moving he code to a behavior and will also try to create an appropriate resolver to allow the usage of a wicket:footnote tag. But I thougth I'd ask if there isn't already something like it out there. Cheers, Chris The Sanity Resorthttp://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/ Am 18.09.2011 22:57, schrieb Dan Retzlaff: Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huberhub...@butterbrot.org* *wrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resorthttp://sanityresort.**blogspot.http://sanityresort.blogspot. **com/http://**sanityresort.blogspot.com/http://sanityresort.blogspot.com/
Re: Footnote-Support
Well, after about two days I finally got it working ;-) I'll try to scratch together a blog post in the next days with the details :-) The Sanity Resort http://sanityresort.blogspot.com/ Am 19.09.2011 16:41, schrieb Dan Retzlaff: I see now. Forget the behavior approach. :) How about keeping a ListString of footnotes in the page's metadata (i.e. getPage().setMetaData(FOOTNOTES))? Create (1) a Label-like component which, in its onInitialize(), adds its contents to the list and saves the new index to be rendered as the footnote annotation, and (2) a FeedbackPanel-like component which renders the footnote content as an ordered list. You may also be able to put the footnotes into the Session's feedback data as Martin suggests, but I'm not sure how the footnote annotation and footnote content would be differentiated. On Mon, Sep 19, 2011 at 1:15 AM, Christian Huberhub...@butterbrot.orgwrote: Hi Dan, thanks for your answer. To be a bit more clear about what I want, I would like (spoken simplified) to add a footenote to a label like Some textsup1/sup and automatically have the footbnote text appear at the bottom of the corresponding page. Right now I have a Label subclass to do this (and a bit more) but am moving he code to a behavior and will also try to create an appropriate resolver to allow the usage of a wicket:footnote tag. But I thougth I'd ask if there isn't already something like it out there. Cheers, Chris The Sanity Resorthttp://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/ Am 18.09.2011 22:57, schrieb Dan Retzlaff: Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huberhub...@butterbrot.org* *wrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resorthttp://sanityresort.**blogspot.http://sanityresort.blogspot. **com/http://**sanityresort.blogspot.com/http://sanityresort.blogspot.com/
Re: Footnote-Support
Hi Dan, thanks for your answer. To be a bit more clear about what I want, I would like (spoken simplified) to add a footenote to a label like Some text sup1/sup and automatically have the footbnote text appear at the bottom of the corresponding page. Right now I have a Label subclass to do this (and a bit more) but am moving he code to a behavior and will also try to create an appropriate resolver to allow the usage of a wicket:footnote tag. But I thougth I'd ask if there isn't already something like it out there. Cheers, Chris The Sanity Resort http://sanityresort.blogspot.com/ Am 18.09.2011 22:57, schrieb Dan Retzlaff: Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huberhub...@butterbrot.orgwrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resorthttp://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/
Re: Footnote-Support
It sounds like a FeedbackPanel with a component filter that filters all components annotated somehow to be a footnote will do the job. On Mon, Sep 19, 2011 at 11:15 AM, Christian Huber hub...@butterbrot.org wrote: Hi Dan, thanks for your answer. To be a bit more clear about what I want, I would like (spoken simplified) to add a footenote to a label like Some text sup1/sup and automatically have the footbnote text appear at the bottom of the corresponding page. Right now I have a Label subclass to do this (and a bit more) but am moving he code to a behavior and will also try to create an appropriate resolver to allow the usage of a wicket:footnote tag. But I thougth I'd ask if there isn't already something like it out there. Cheers, Chris The Sanity Resort http://sanityresort.blogspot.com/ Am 18.09.2011 22:57, schrieb Dan Retzlaff: Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huberhub...@butterbrot.orgwrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resorthttp://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/ -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Footnote-Support
I see now. Forget the behavior approach. :) How about keeping a ListString of footnotes in the page's metadata (i.e. getPage().setMetaData(FOOTNOTES))? Create (1) a Label-like component which, in its onInitialize(), adds its contents to the list and saves the new index to be rendered as the footnote annotation, and (2) a FeedbackPanel-like component which renders the footnote content as an ordered list. You may also be able to put the footnotes into the Session's feedback data as Martin suggests, but I'm not sure how the footnote annotation and footnote content would be differentiated. On Mon, Sep 19, 2011 at 1:15 AM, Christian Huber hub...@butterbrot.orgwrote: Hi Dan, thanks for your answer. To be a bit more clear about what I want, I would like (spoken simplified) to add a footenote to a label like Some text sup1/sup and automatically have the footbnote text appear at the bottom of the corresponding page. Right now I have a Label subclass to do this (and a bit more) but am moving he code to a behavior and will also try to create an appropriate resolver to allow the usage of a wicket:footnote tag. But I thougth I'd ask if there isn't already something like it out there. Cheers, Chris The Sanity Resort http://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/ Am 18.09.2011 22:57, schrieb Dan Retzlaff: Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huberhub...@butterbrot.org* *wrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resorthttp://sanityresort.**blogspot.http://sanityresort.blogspot. **com/http://**sanityresort.blogspot.com/http://sanityresort.blogspot.com/
Footnote-Support
Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resort http://sanityresort.blogspot.com/
Re: Footnote-Support
Hi Christian, I don't understand the particular hierarchy placement you have in mind, but I'd guess that you could write a Behavior that does it. Behaviors get callbacks for component tags, rendering events, etc. Dan On Sun, Sep 18, 2011 at 12:12 PM, Christian Huber hub...@butterbrot.orgwrote: Hi all, I was wondering if there is something like a footnote component/behavior or similar. A mechanism that allows you to easily add a footnote to a label and the corresponding footnote text to one of it's parents in a generic way. I know I could just add a footnote to a label and another label containing the footnote text but that does not work in a generic way. Cheers, Chris -- The Sanity Resort http://sanityresort.blogspot.**com/http://sanityresort.blogspot.com/