Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.3.0-rc1
-
None
Description
In my wicket programming experience so far I always didn't feel quite comfortable with the ajax part.
I had some issues in particular with these as an example:
- "Always include a common feedback panel from my template page"
--> add 'target.addComponent(feedbackPanel)' just everywhere (very cumbersome and not elegant at all)
- add a listener using AjaxRequestTarget#addListener
--> not possible without subclassing the request cycle (which is yuk if you ask me) to catch the short moment in between AjaxRequestTarget is instantiated and AjaxRequestTarget#onRespond() is called
- automatically set focus on the first form component with errors
--> add bulky code into all onSubmit() and onError() to check for errrors and call AjaxRequestTarget#setFocus
- add some common function like AjaxRequestTarget#yellowFade(FormComponent)
--> have some utility method and call it like this: AjaxUtil.yellowFade(target) – not nice as functionality like this should really belong to the request target
I found that all these issues can be solved very elegantly if you could just catch the moment where AjaxRequestTarget is instantiated.
I attached a very little patch which solves all that issues and makes ajax just a lot more powerful inside wicket imho
also, it will not break current code but is just an enhancement you will not notice unless you need it.