Announcement Announcement Module
No announcement yet.
Need help with Validation Rule Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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:
    add("amount", ifTrueElse(eq("paymentType", PaymentType.CREDIT), 
                value("amount", gt(0.0d)), value("amount", lt(0.0d))));
    The ErrorMessage:
    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,

  • #2
    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.


    • #3
      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.