Get a list of all UI Components used in GUI
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi All!
I'm working on a program which has several input fields, takes the filled in information by the user and starts a query to a database with the specified conditions (something like "SELECT * FROM Foo WHERE Field = 'specified value' AND (...)"). The retrieval works fine, but my approach is really cumbersome and errorprone at the moment. Here is how i construct the WHERE-clause:
function where_clause = constructWhereClause(handles)
where_clause = '';
bezeichnung_arr = get(handles.bezeichnung_edit, 'UserData');
if ~isempty(bezeichnung_arr{2})
where_clause = [ bezeichnung_arr{1} '=''' bezeichnung_arr{2} ''''];
end
derivat_arr = get(handles.derivat_popup, 'UserData');
if ~isempty(derivat_arr{2})
if ~isempty(bezeichnung_arr{2})
where_clause = [where_clause ' AND '];
end
where_clause = [where_clause derivat_arr{1} '=''' derivat_arr{2} ''''];
end
My question is: Is there a way to get a list of all ui components of a gui so I can iterate over them and access their "UserData" property in a for-loop? Since there are many edit fields more to come, this approach will not be the best to construct my statement.
Thanks in advance!
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!