@DomainService(nature=NatureOfService.VIEW_MENU_ONLY)
@DomainObjectLayout(named="Scalar Demo")
public class ScalarMenu {
@Inject private FactoryService factoryService;
@Action
@ActionLayout(cssClassFa="fa-font")
public TextDemo text(){
val demo = factoryService.instantiate(TextDemo.class);
return demo;
}
}
@XmlRootElement(name = "Demo")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
@DomainObject(nature=Nature.VIEW_MODEL)
@Log
public class TextDemo {
@PostConstruct
public void initDefaults() {
log.info("TextDemo::initDefaults");
string = "a string (click me)";
}
@Property(editing=Editing.ENABLED)
@XmlElement @Getter @Setter private String string; }