I have struggled with the excact same problem, I just solved it by not
attaching the error to a specific component.

Of course, it would be better to attach the error to the correct field, with
standard error display.

On 3/5/06, Alan Chandler <[EMAIL PROTECTED]> wrote:
>
> I am using a @For loop to generate a set of input fields.
>
> <div jwcid="[EMAIL PROTECTED]" source="ognl:roleList" value="ognl:role"
> class="ognl:beans.evenOdd.next + ' role'" index="ognl:index"
> element="div">
>                 <input jwcid="[EMAIL PROTECTED]" value="ognl:role.name"
> validators="validators:required"/>
> ...
>
>
> In my listener, I have discovered one of the fields is in error [attempt
> to
> update to the same name as another already in the database] and want to
> set
> the delegate component to the correct input field to declare the
> error.  In
> the code snippet below, index has been set to the loop index
>
>                         String field = "rolenam";
>                         if(index > 0) {
>                                 field = "rolenam_" + Integer.toString
> (index-1);
>                         }
>                         try {
>                                 vru.update();
>                         } catch (DatabaseException dbe) {
>                                 delegate.setFormComponent((IFormComponent)
> getComponent(field));
>
> But I am crashing out at the last line with unknown component.
>
> How should I identify the specific component input field?
>
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
> Open Source. It's the difference between trust and antitrust.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to