render errors.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

render errors.

Mauro
class Supplier {
  String companyName
  static hasMany = [ phones:Phone ]

and

class Phone {
  String number
  static constraints = {
        number nullable:true, matches: /\d+/
    }


the form is something like:

<g:renderErrors bean="${supplierInstance} />

<g:textField name="companyName" value="${supplierInstance?.companyName}"/>

<g:textField name="phones[0].number" value="${supplierInstance?.phones?.getAt(0)?.number}"/>

<g:textField name="phones[1].number" value="${supplierInstance?.phones?.getAt(1)?.number}"/>

errors are rendered for the class Supplier but if the phones have error I see that errors are rendered also for the class Phone.
But if the bean in the renderErrors is supplierInstance why I see also the errors of the Phone class?
Reply | Threaded
Open this post in threaded view
|

Re: render errors.

Mauro
examples:

  • Property [vatNumber] of class [Supplier] with value [11111111111] must be unique
  • Property [number] of class [class supplierregister.Phone] with value [wwefeww] does not match the required pattern [\d+]

Reply | Threaded
Open this post in threaded view
|

Re: render errors.

SAgrawal14
Sinces Phone is in many to one relation ship with the Supplier, it will happen.


On Fri, Dec 27, 2013 at 5:24 AM, Mauro Sanna <[hidden email]> wrote:
examples:

  • Property [vatNumber] of class [Supplier] with value [11111111111] must be unique
  • Property [number] of class [class supplierregister.Phone] with value [wwefeww] does not match the required pattern [\d+]


Thank You,

SA