Hi Gabriel,
as Vladimir says, that validatePrice(...) is only fired when the property
itself is edited.
And, as he also says, one solution is to add a validateXxx method for the
action, eg:
public String validate1NewCategory() {
return price = 0? null : The price must not be negative!;
}
Vladimir,
Price is a property of a domain object.
The whole code:
package dom.simple;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import
Hi Gabriel, just tried your code with DomainService Categories
package dom.simple;
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.DomainService;
@DomainService
public class Categories {
public Category newCategory(
String name,
Sorry for insist in this question, but I have tried many things and I can't
resolve. I have used the validate method for attributes in other systems I
have made, but this one I really don't know what is happening. Maybe
(propably) it's something stupid... =D
Thank you for support.
Gabriel
Hi.
I've created a validate method for an attribute but when I insert the
entity that contains such attribute, the validate is not called by the
interface. I don't know what is wrong. Someone can help?
Code:
public String validatePrice(Double price) {
if (price = 0) {