Results 1 to 3 of 3

Thread: Need help with Validation Rule

  1. #1

    Question Need help with Validation Rule

    I have a Bean with two depending Properties. The value-Property depends not only on the existance of the paymentType-Property but accessorily on its value.

    I tried the following:
    Code:
    add("amount", ifTrueElse(eq("paymentType", PaymentType.CREDIT), 
                value("amount", gt(0.0d)), value("amount", lt(0.0d))));
    The ErrorMessage:
    Code:
    org.springframework.beans.NotReadablePropertyException: Invalid property 
    'paymentType' of bean class [java.lang.Double]: Bean property 'paymentType'
    is not readable or has an invalid getter method: Does the return type of the
    getter match the parameter type of the setter?
    How do I have to implement that ifThanElse Contraint for a Property depending on the Value of an other one?

    Thanks for hints,
    sebastian

  2. #2
    Join Date
    Apr 2006
    Location
    Germany, Berlin
    Posts
    61

    Default

    That is currently a weak point in spring rcp. If a property constraint is nested in a non property constraint it will not be processed in the right way. You have to create a IfTrueElsePropertyConstraint which knows how to handle the property constraints.
    ___
    Mathias

  3. #3

    Default

    Thanks for the reply Mathias,

    do I have to implement that case of PropertyConstraint by myself or is it possible to built it out of the existing Constraints? Did you implement something like that, yet?

    By now I just needed the "simple" Contraints provided in the sample apps and the docs. After digging in the source today I did not really get the whole image. If there is any, an Example would help understand things, I think.

Posting Permissions

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