disable input of datefield

i want to disable input the date of DateField, not setEnabled().what should i do? thank all!

does setReadOnly(true) not work?

yes! i just want to disable input date,however i still want to click that icon on the right and chose a date value.


i already solve this problem:

i use a empty horizontallayout cover this DateField Componenet,and follow css can solve it

background-color: #FFFFFF;
margin-left: -190px;
z-index: 99999;
position: absolute;


it works nice…but still have a little problem…the input textfield of DateField will get focus when i chose a date,
i don not hope it happen.

is there anyone can help me? thanks all!

Don’t you think someone can still edit this field by removing the css cover on the client side?

yes! you are right. thank you your tips! is there any good method you can tell me?

Im very interested in that too.
Disabling textual input, editing ONLY by popup is needed.

Is there any solution yet?

I am also looking for a solution for this.
Any solution yet?

Personally I don’t know how to do it properly with DateField, but if it’s not possible with the stock component then you can create a custom one.

You could use a Label in HorizontalLayout with CSS visually imitating a DateField and a PopupView with InlineCalendar to select date. Then use LayoutClickListener to glue it together i.e. clicking on a Label would change the visibility of PopupView.

your needed, add this.
if you meant that you want to select only date and not time, use setResolution().
.setResolution (DateField.RESOLUTION_DAY);