Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Set current date as default date in calendar only but it is also displaying in text field

    My requirement is to set current date as default date in calendar only but it is also displaying in text field .
    Below is my code.
    private static DynamicForm createDateItem(String name) {
    final DateItem dateItem = new DateItem("name");
    dateItem.setRequired(false);
    final DynamicForm form = new DynamicForm();
    form.setTitleSuffix("");
    form.setItems(dateItem);
    form.setZIndex(0);
    dateItem.setTitle("");
    dateItem.setUseTextField(true);
    dateItem.setEnforceDate(true);

    final DateDisplayFormat format = DateDisplayFormat.TOEUROPEANSHORTDATE;
    dateItem.setDateFormatter(format);
    dateItem.setInputFormat("DMY");
    dateItem.setDisplayFormat(format);

    return form;
    }

    Screenshot is attached. Please look in to this.

    Attached Files

    #2
    What are you trying to say here - you want to disallow text entry, so the user is forced to click only on the icon as a means of changing the date?

    While this could be done via the AutoChild system to edit the textField that is used for date entry to make it read-only, this seems to be a purely worse UI, so why do it?

    Comment

    Working...
    X