フィルターのクリア

AppDesigner/UICalendar Error - "There is no String Property on the EditField class"

1 回表示 (過去 30 日間)
Matt
Matt 2017 年 6 月 6 日
コメント済み: Matt 2017 年 6 月 13 日
Hi, I'm using the app designer to build an application that needs a date from the user, can someone please explain what I am missing to have the date selected output to a Edit Field (Text). My simple button that calls the calendar has this code:
uicalendar('InitDate',datetime(2017,5,1),'DestinationUI', app.WindowStartDateEditField);
Any help would be greatly appreciated!

回答 (1 件)

Arnav Mendiratta
Arnav Mendiratta 2017 年 6 月 13 日
As the documentation mentions, uicalendar should be used with uicontrol type objects. Currently, having uicontrol object within App Designer is not supported.
The reason you get this error is because "uicalendar" expects to populate the 'String' Property of a "uicontrol" object. However, your app.WindowStartDateEditField is App Designer's Edit Field object. This object uses app.WindowStartDateEditField.Value to populate the typed text and does not have any property like app.WindowStartDateEditField.String.
You may use a workaround though:
1. Have a different UI altogether to select the date which would look somewhat like this .
2. Within your app, create a button "Select Date" which will launch this UI.
3. Have this UI pass the string value to app.WindowStartDateEditField.Value.
  1 件のコメント
Matt
Matt 2017 年 6 月 13 日
Thanks for the response! I eventually also found that it was not supported via App Designer, but thank you very much for the workaround!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by