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]