Yes, its Boolean. Tried with a different method, this one with no parameters,
with both disable and hide action methods. Disable worked, hide didn't.
//region > deliveryStarted (action)
@MemberOrder(name="status",sequence = "2")
@ActionLayout(position = ActionLayout.Position.PANEL_DROPDOWN)
public CustomerOrder deliveryStarted() {
setDeliveryStartedTime(clockService.nowAsDateTime());
setStatus(CustomerOrderStatus.IN_TRANSIT);
return this;
}
// disable action dependent on state of object
public String disableDeliveryStarted() {
return status.equals(CustomerOrderStatus.IN_TRANSIT) ? "Customer order
is already being delivered" : null;
}
// disable action dependent on state of object
public Boolean hideDeliveryStarted() {
return status.equals(CustomerOrderStatus.IN_TRANSIT) ? true : false;
}
domainapp.dom.simple.customerorders.CustomerOrder#hideDeliveryStarted: has
prefix hide, is probably a supporting method for a property, collection or
action. If the method is intended to be an action, then rename and use
@ActionLayout(named="...") or ignore completely using @Programmatic
Please inspect the above messages and correct your domain model.
-----Original Message-----
From: Dan Haywood [mailto:[email protected]]
Sent: Wednesday, November 4, 2015 5:15 PM
To: users
Subject: Re: Metamodel validation
No, hide has been around a long time.
Is should return a boolean, not a String; does it?
On 4 November 2015 at 23:11, Cesar Lugo <[email protected]> wrote:
> Matched, and now It worked just fine, thanks!
>
> By the way, I now tried replacing disableAssignForDelivery with
> hideAssignForDelivery, and I get a new metamodel validation. Is hide
> prefix a new 1.10.0 feature not yet available in 1.9.0 ?
>
> Cesar.
>
> -----Original Message-----
> From: Dan Haywood [mailto:[email protected]]
> Sent: Wednesday, November 4, 2015 4:17 PM
> To: users
> Subject: Re: Metamodel validation
>
> In 1.9.0 the disable method must match the parameters of the action.
>
> So action:
>
> public CustomerOrder assignForDelivery(Deliverer deliverer)
>
> should have a disable method of:
>
> public String disableAssignForDelivery(Deliverer deliverer).
>
>
> I must admit I am always making this mistake myself, so in
> 1.10.0-SNAPSHOT the framework will also accept the no-arg version (as you've
> written it).
>
> HTH
> Dan
>
>
>
> On 4 November 2015 at 21:50, Cesar Lugo <[email protected]> wrote:
>
> > Hello,
> >
> >
> >
> > I have a metamodel validation and I cant find what the issue is.
> >
> >
> >
> > My code is the following:
> >
> >
> >
> > //region > assignForDelivery (action)
> >
> > @MemberOrder(name="status",sequence = "1")
> >
> > @ActionLayout(position = ActionLayout.Position.PANEL_DROPDOWN)
> >
> > public CustomerOrder assignForDelivery(
> >
> > final @ParameterLayout(named = "Delivered By") Deliverer
> > deliverer
> >
> > ) {
> >
> > setDeliveredBy(deliverer);
> >
> > setAssignedForDeliveryTime(clockService.nowAsDateTime());
> >
> > setStatus(CustomerOrderStatus.ASSIGNED_FOR_DELIVERY);
> >
> > return this;
> >
> > }
> >
> >
> >
> > // disable action dependent on state of object
> >
> > public String disableAssignForDelivery() {
> >
> > return status.equals(CustomerOrderStatus.ASSIGNED_FOR_DELIVERY) ?
> > "Customer order is already assigned for delivery" : null;
> >
> > }
> >
> > //endregion
> >
> >
> >
> > Then I get the following metamodel validation error:
> >
> >
> >
> >
> domainapp.dom.simple.customerorders.CustomerOrder#disableAssignForDelivery:
> > has prefix disable, is probably a supporting method for a property,
> > collection or action. If the method is intended to be an action,
> > then rename and use @ActionLayout(named="...") or ignore completely
> > using @Programmatic
> >
> >
> >
> > I have even changed the name of the method and still get the same error.
> >
> >
> >
> > Cesar.
> >
> >
> >
> >
> >
> > ---
> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus
> >
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus