you could generalize this by making a request cycle with a custom response
installed that does this.  if this is a totally separate application for
you, you could create an abstraction like TemplateGeneratingApplication
which does the fancy request cycle stuff behind the scenes.  in fact, this
seems like a nice wicket-stuff project someone out there might help you
with.

   jonathan


Doug Leeper wrote:
> 
> I believe the following is the correct way (it works from my point of
> view).  Are there any issues that I need to be aware of?  Is there a
> better way?
> 
> Thanks
> - Doug
> 
> Note: this method is called in either a Link or Button:
> 
> public BaseTemplate extends WebPage {
> 
>       public String generateHTML() {
>               StringResponse stringResponse = new StringResponse();
>               WebResponse originalResponse = (WebResponse) RequestCycle.get()
>                               .getResponse();
>               try {
>                       RequestCycle.get().setResponse(stringResponse);
> 
>                       this.render();
>               } finally {
> 
>                       RequestCycle.get().setResponse(originalResponse);
>               }
>               return stringResponse.toString();
>       }
> }
> 

-- 
View this message in context: 
http://www.nabble.com/Wicket-as-a-template-generator-tp16609133p16610910.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to