Selecting an empty drop down uicontrol in AppDesigner

3 次查看(过去 30 天)
When clicking on the empty, small size area that appears when expanding an empty uidropdown control, how can the following warning be avoided (obviously not merely by turning that warning off):
empty uidropdown.PNG
% Warning: Error occurred while executing the listener callback for event GuiEvent defined for class
% appdesservices.internal.peermodel.ServerDrivenPeerNodeProxyView:
% Unable to perform assignment with 0 elements on the right-hand side.
%
% Error in matlab.ui.control.internal.model.ExactlyOneSelectionStrategy/getSelectedTextGivenIndex (line 268)
% value = obj.Component.PrivateItems{index};
%
% Error in matlab.ui.control.internal.model.SelectedTextValueStrategy/getValueGivenIndex (line 53)
% value = obj.Component.SelectionStrategy.getSelectedTextGivenIndex(index);
%
% Error in matlab.ui.control.internal.model.AbstractStateComponent/getValueGivenIndex (line 401)
% value = obj.ValueStrategy.getValueGivenIndex(index);
%
% Error in matlab.ui.control.internal.controller.DropDownController/handleEvent (line 44)
% previousValue = obj.Model.getValueGivenIndex(previousSelectedIndex);
%
% Error in appdesservices.internal.interfaces.controller.AbstractController/handleProxyViewEvent (line 279)
% handleEvent(obj, src, event);
%
% Error in appdesservices.internal.interfaces.controller.AbstractController>@(src,event)handleProxyViewEvent(obj,src,event)
%
% Error in appdesservices.internal.interfaces.view.AbstractProxyView/notify (line 117)
% obj.notify@handle(varargin{:});
%
% Error in appdesservices.internal.peermodel.PeerNodeProxyView/handlePeerEventFromClient (line 214)
% notify(obj, 'GuiEvent', eventData);
%
% Error in appdesservices.internal.peermodel.PeerNodeProxyView>@(varargin)obj.handlePeerEventFromClient(varargin{:}) (line 78)
% obj.PeerEventListener = addlistener(obj.PeerNode, 'peerEvent', @obj.handlePeerEventFromClient);
%
% Error in hgfeval (line 62)
% feval(fcn{1},varargin{:},fcn{2:end});
%
% Error in javaaddlistener>cbBridge (line 52)
% hgfeval(response, java(o), e.JavaEvent)
%
% Error in javaaddlistener>@(o,e)cbBridge(o,e,response) (line 47)
% @(o,e) cbBridge(o,e,response));

回答(1 个)

Rajani Mishra
Rajani Mishra 2019-10-18
Hi,
Without having a look at the code, I think the error you are facing is because the listener callback which you have implemented is not able to receive any value because of the empty drop down uicontrol having no value to be assigned.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by