Jan Blok wrote:
Hi,
My ideas:
1) A component can implement a sub-interface of IAjaxListener (as seen in
the wicket source already) it tells it's support AJAX
component doesn't have to implement a interface anymore. You can add
ajaxlisteners now to a component.
so it is not needed to subclass.
2) after an IAjaxListener sub interface method is invoked, changes to
components are collected in a delegate
This things are already in the current cvs. See EventRequestHandler
benefits:
1) server knows components states on client
2) all changes to different components are seen and returned at once
3) standarized way by which changes over multiple components are returned
4) ajax is completly invisible for wicket developer, it powerfull yet free
5) auto fallback on normal wicket behavior if ajax is not supported by
browser
--------------implementation details:
needed in wicket Component class:
1) delegate to changes-collector implentation
2) renderAjaxComponent method which requests javascript change statments
from delegate and provides hook for developer to add its own javascript
statements (for example calls to javascript he included in page)
3) javascript id (from html markup or generated one) to be used by delegate
The changes collector implementation is the IAjaxRenderer and a
component should only have one
if it wants ajax rendering the normal component shouldn't have much
support for it only the specific cases
And you don't want to enabled it by default for every component because
the changes collection can grow
very large with many pages and components. And all clustering things
should also taken into account
so that we can have as light versions as possible for a page.
You could have a page/container.setAjaxRendering() that would traverse
through all the components and call
the setAjaxRendering(true) which calls the createAjaxRenderer() method
to create the ajax delegate.
So that there is a choice to set it throughout the complete page/container
But there should be choice by not setting specific components to have a
ajax renderer.
johan
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop