I would just do traditional server side validation in SimpleFormController's
onBindAndValidate which has the logic of vehicle - > attribute lookup and
validation.

Sanjiv

On 11/28/06, pat79 <[EMAIL PROTECTED]> wrote:


Hi,

i'm working on a project, where attributes and entities are stored in
different tables. The reason therefore is, that attributes depend on the
type of an entity. e.g. For a lorry you may need an attribute
"load_in_kg",
for a cabriolet this isn't very important, instead you need the attribute
"fun_factor". Such as this:

table "vehicle"
ID    name             vehicle_type_id
--------------------------------------------------
1    volvo g38         5
2    mercedes slk     6
3    dodge viper      7

table "vehicle_type"
ID   name
--------------------
5    lorry
6    cabriolet
7    hellraiser

table "vehicle_attributes"
ID    name                vehicle_type_id    required
---------------------------------------------------------------------
1     load_in_kg         5                          yes
2     fun_factor         6                          yes
3     horsepower       6                          no
4     acceleration       7                          yes


My idea for validating the attributes dependent on the vehicle_type is to
read the attributes at runtime and generate a String which looks like
"validation.xml". Now i want to validate the form submission with this
XML-String. Is there a possibility to do this in the SimpleFormController
or
has anyone a better approach to come along with this problem?

Thanks in Advance,
Patrick
--
View this message in context:
http://www.nabble.com/Validation-Rules-at-Runtime-from-DB-tf2717247s2369.html#a7576009
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to