Thank you Peter. That link was extremely helpful! Joe
-----Original Message----- From: Peter Thomas [mailto:[email protected]] Sent: Thursday, August 27, 2009 8:12 AM To: [email protected] Subject: Re: using behaviors as borders - how to? On Thu, Aug 27, 2009 at 5:31 PM, Joe Hudson <[email protected]>wrote: > Hello, > > I would like to add a behavior to a component which alters the HTML output > related to that component. I know that you can use setComponentBorder but I > saw a posting that mentioned behaviors were the more appropriate way to do > this as explicit component borders might become deprecated. > > I am trying to do something simple like wrap a form component with a label. > For example: > Instead of a form component rendering as: > <input type="text" .../> > > I would like the behavior to help the component to render as > <li><label>Some Label</label> <input type="text" .../></li> > > So, the label component would be responsible for wrapping the inner content > with: > <li><label>Some Label</label> {inner content} </li> > > Here is where I am at: > > - I know I probably want to extend AbstractBehavior > > - I know I probably want to use the beforeRender and afterRender > methods to do this > > Would anyone be able to give me some pointers to get started on this? > Thank you very much. > > Al Maw's "Forms With Flair" presentation is a good start, you can find it here: http://jweekend.co.uk/dev/ArticlesPage > > Regards, > > Joe > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
