-
Jul 19th, 2012, 05:42 PM
#1
Multiple ModelAttributes, multiple validations
Think of a page with master and detail records on it, with separate classes for the master record and the detail record. How do you do that with Spring? I've read the reference guide for Spring, and it never really says how to do it. Unless I missed it, of course!
Can you help?
-
Jul 20th, 2012, 01:48 PM
#2
Never mind. I figured it out.
-
Aug 29th, 2012, 09:11 AM
#3
how did you do that? I am in similar situation?
-
Aug 29th, 2012, 10:29 AM
#4
If you're in a master-detail kind of relationship, the foreign key is already on the master. For example (in my case):
Master Table:
UIDMaster key for the master
UIDDetail key for the details
In the class which you generated, you'll see a place where you refer to a class in the master class:
Detail detail- or -
Detail uIDDetail
You only need one validator - the master validator. Where you need to refer to fields actually on the detail class, you do it like this:
detail.info-from-the-detail
Make sense?
-
Aug 29th, 2012, 10:31 AM
#5
it does..thanks for the reply..it really helps!
-
Aug 29th, 2012, 10:59 AM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules