public class ComponentParameter { @Persist("flash") private String message; public String getMessage() { return message; } void onActionFromBlockAction() { message = "Link was clicked."; } }
public class SecurityAlert { @Persist("flash") private String message; public String getMessage() { return message; } public void setMessage(String mesasge) { message = mesasge; } }
public class TestPageForForm { @Persist private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
public class ValidateFormValidationExceptionDemo { @Property @Persist private String event; void onValidateFromForm() throws ValidationException { throw new ValidationException("From event handler method."); } void onSuccessFromForm() { event = "success"; } void onFailureFromForm() { event = "failure"; } }
public class ValidateCheckboxMustBeChecked { @Property @Persist private boolean value; }
public class SingleErrorDemo { @Persist @Property private String username, password, email; }
public class ComplexBeanDemo { @Property @Persist private ComplexBean complexBean; }
public class NestedBeanDisplay { @Persist @Property private Person parent; Object initialize(Person person) { parent = person; return this; } }
public class KaptchaDemo { @Property @Persist(PersistenceConstants.FLASH) private String message; void onSuccessFromForm() { message = "Kaptcha passed."; } }
public class ValidateCheckboxMustBeUnchecked { @Property @Persist private boolean value; }
public class BlankPasswordDemo { @Persist @Property private String password; }
public class BeanEditFormPrepareBubbling { @Property @Persist private Person person; private boolean eventHandled; void onPrepare() { if(eventHandled) throw new IllegalStateException("Illegal event handler invocation. The 'prepare' event has been already handled"); eventHandled = true; } }
public class LinkSubmitWithoutValidatorDemo { @Property private String searchString; @Property @Persist private String result; @OnEvent(component = "searchForm", value = EventConstants.SUCCESS) void onSearchSuccess() { result = "" + searchString + " not found!"; } }
@Import(stack = "core") public class BeanEditFormValidationDemo { @Property @Persist private User user; }
public class SelectModelCoercionDemo { @Inject private MusicLibrary library; @Property @Persist private Track track; public List<Track> getTracks(){ return library.getTracks(); } }
public class ZoneFormUpdateDemo { @Property @Persist(PersistenceConstants.FLASH) private String value; @Inject private Block fields; Object onActionFromUpdate() { return fields; } }
@Import(stack = "core") public class ClientValidationDemo { @Property @Persist private TestEntity testEntity; public StringValueEncoder getStringValueEncoder() { return new StringValueEncoder(); } }
public class UploadBasePage { public static final String TARGET_DIR = "target/tmp/"; @Persist @Property @Validate("required") private UploadedFile file; public void onSuccess() { File copied = new File(TARGET_DIR + file.getFileName()); file.write(copied); } }
public class OverrideDateFieldMessageCatalogDemo { @Inject @Property private Messages messages; @Persist @Property private Date birthday; }