Is it possible to enforce a date (and display date picker) for a field within a prompt bean plugin, similar to the variable prompt setting "prompt as date input"? @Date annotation on getter methods seems to have no noticeable effect, and neither does setting return type to Date. My current workaround is making it a string and enforcing a weak regex pattern.
In QuickBuild 8.0.11, I do not get a date field when setting the field to Date type. Instead, I get an empty list drop down. I set the field to @NotNull, so it literally just says "Choose One" and the only available option is to "Choose One"
That is already set. Using @Editable(order=100, name="Date", description="The date").
The annotations don't have to be in a certain order, do they?
It is odd that this is working at my side. What I am doing:
- Define a bean for example:
@Editable(name="My Example Bean")
public class MyExampleBean implements Serializable {
private static final long serialVersionUID = 1L;
private Date myDate;
@Editable
public Date getMyDate() {
return myDate;
}
public void setMyDate(Date myDate) {
this.date = date;
}
}
- Return the bean in plugin's getExtensions method:
public class PromptBeanPlugin extends AbstractPlugin {
@Override
public Object[] getExtensions() {
return new Object[]{
new PromptBeanProvider() {
public Class<? extends Serializable> getPromptBeanClass() {
return MyExampleBean.class;
}
},
};
}
}
- Export and deploy the plugin to QB's plugins directory
- Restart QB and add a variable prompting as bean input, and specify the bean as "My Example Bean"
- Run the configuration, and the bean displays a text input with date choose icon at right side.