Behaviours are normally attached to controls. You can then attach Behaviours anywhere you happen to be working with Controls, such as a Page or a Panel. Note if you want to attach Behaviors to Controls within a Panel, then you will need to use a custom Panel class (See http://click.apache.org/docs/click-api/org/apache/click/control/Panel.htmlor http://click.avoka.com/click-examples/panel/reusable-panel-demo.htm)
Mike On Sat, Jul 9, 2011 at 09:51, Nicholas Dierauf < [email protected]> wrote: > Hello,**** > > ** ** > > I have created a web application using Apache Click. I’m currently using a > servlet to handle form posts which returns strings that are parsed by > JavaScript to update content. I am investigating how I can better leverage > Click with Ajax by using AjaxBehavior. The problem is that all of the > examples that I’ve seen all use AjaxBehavior within the Page class, whereas > many of my forms are embedded in Panels in pages.**** > > ** ** > > I’m not quite sure how to work this. Do I really have to place behaviors in > the Page class, or can I put them in the Panel class? **** > > ** ** > > And what should the ‘action’ attribute be for a form in this case (am using > ‘onclick’ attribute in Submit button to make Ajax call but would like to > obtain URL from ‘action’ attribute instead of my home-grown servlet).**** > > ** ** > > Sorry if I’m misunderstanding basic concepts of Apache Click. I love the > framework, but feel that I am somehow missing out on understanding some > basics.**** > > ** ** > > Thanks,**** > > Nick.**** >
