Results 1 to 6 of 6

Thread: Multiple ModelAttributes, multiple validations

  1. #1
    Join Date
    Jun 2012
    Posts
    13

    Default 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?

  2. #2
    Join Date
    Jun 2012
    Posts
    13

    Default

    Never mind. I figured it out.

  3. #3
    Join Date
    May 2012
    Posts
    5

    Default

    how did you do that? I am in similar situation?

  4. #4
    Join Date
    Jun 2012
    Posts
    13

    Default

    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?

  5. #5
    Join Date
    May 2012
    Posts
    5

    Default

    it does..thanks for the reply..it really helps!

  6. #6
    Join Date
    Jun 2012
    Posts
    13

    Default

    You're welcome!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •