On Thu, Oct 28, 2010 at 5:19 PM, Clint Checketts <checke...@gmail.com>wrote:

> I have a Visitor that iterates through my forms and adds a Behavior that
> writes out to the Response a <div> and any feedback messages that belong to
> that component. This is really great because it gives me inline feedback
> panels. Here is the problem: if the component is ever updated via ajax, the
> component the behavior is tied to get replaced in the DOM, but the feedback
> messages get written out in another <div> again.
>
> My core need is to create some sort of auto-adding inline feedbackpanel.
>
> Any good recommendations on how to work around this? It's such a good
> design
> pratice to have error messages next to the offending input fields, I'm sure
> others have had to deal with this.
>

A couple options:

   - Use a Border.  Of course, then it's harder to add this automatically
   because a border will look for the html in the parent container.
   - in your behavior, in the div you render, render the div with the markup
   ID of the component you are wrapping, and then call setOutputMarkupId(false)
   on the component you are wrapping.  thus, you are moving the markup id up to
   the wrapping div.
   - if you are using wicket 1.4.10 or greater,
   implement IAjaxRegionMarkupIdProvider, which allows you to override the id
   of the markup region that will updated via ajax

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to