@@ -149,11 +149,27 @@ public void QualiferUpgradeReferable(List<QualifierPreset> presets, IReferable r
149
149
public void QualifierHelper (
150
150
AnyUiStackPanel stack , ModifyRepo repo ,
151
151
List < Aas . IQualifier > qualifiers ,
152
+ Action setQualifiersNull = null ,
152
153
Aas . IReferable relatedReferable = null ,
153
154
AasxMenu superMenu = null )
154
155
{
156
+ // access
157
+ if ( qualifiers == null )
158
+ return ;
159
+
155
160
if ( editMode )
156
161
{
162
+ // some hints
163
+ this . AddHintBubble (
164
+ stack , hintMode ,
165
+ new [ ] {
166
+ new HintCheck (
167
+ ( ) => qualifiers ? . IsValid ( ) != true ,
168
+ "According to the specification, an existing list of elements shall contain " +
169
+ "at least one element and for each element all mandatory fields shall be " +
170
+ "not empty." )
171
+ } ) ;
172
+
157
173
// let the user control the number of references
158
174
AddActionPanel (
159
175
stack , "Qualifier entities:" ,
@@ -186,7 +202,7 @@ public void QualifierHelper(
186
202
if ( presets == null )
187
203
{
188
204
Log . Singleton . Error (
189
- $ "JSON file for Quialifer presets not defined nor existing ({ pfn } ).") ;
205
+ $ "JSON file for Qualifier presets not defined nor existing ({ pfn } ).") ;
190
206
return new AnyUiLambdaActionNone ( ) ;
191
207
}
192
208
@@ -236,8 +252,14 @@ public void QualifierHelper(
236
252
}
237
253
}
238
254
239
- if ( buttonNdx == 3 && qualifiers . Count > 0 )
240
- qualifiers . RemoveAt ( qualifiers . Count - 1 ) ;
255
+ if ( buttonNdx == 3 )
256
+ {
257
+ if ( qualifiers . Count > 0 )
258
+ qualifiers . RemoveAt ( qualifiers . Count - 1 ) ;
259
+
260
+ if ( qualifiers . Count < 1 )
261
+ setQualifiersNull ? . Invoke ( ) ;
262
+ }
241
263
242
264
return new AnyUiLambdaActionRedrawEntity ( ) ;
243
265
} ) ;
@@ -269,6 +291,11 @@ public void QualifierHelper(
269
291
{
270
292
case 0 :
271
293
qualifiers . Remove ( qual ) ;
294
+ if ( qualifiers . Count < 1 )
295
+ {
296
+ qualifiers = null ;
297
+ setQualifiersNull ? . Invoke ( ) ;
298
+ }
272
299
action = true ;
273
300
break ;
274
301
case 1 :
@@ -330,16 +357,6 @@ public void QualifierHelper(
330
357
331
358
// SemanticId
332
359
333
- AddHintBubble (
334
- substack , hintMode ,
335
- new [ ] {
336
- new HintCheck (
337
- ( ) => {
338
- return ( qual . SemanticId == null || qual . SemanticId . IsEmpty ( ) ) &&
339
- ( qual . Type == null || qual . Type . Trim ( ) == "" ) ;
340
- } ,
341
- "Either a semanticId or a type string specification shall be given!" )
342
- } ) ;
343
360
if ( SafeguardAccess (
344
361
substack , repo , qual . SemanticId , "semanticId:" , "Create data element!" ,
345
362
v =>
@@ -394,6 +411,15 @@ public void QualifierHelper(
394
411
}
395
412
396
413
// Type
414
+ AddHintBubble (
415
+ substack , hintMode ,
416
+ new [ ] {
417
+ new HintCheck (
418
+ ( ) => {
419
+ return ( qual . Type == null || qual . Type . Trim ( ) == "" ) ;
420
+ } ,
421
+ "Type string specification shall be given!" )
422
+ } ) ;
397
423
398
424
AddKeyValueExRef (
399
425
substack , "type" , qual , qual . Type , null , repo ,
@@ -1216,6 +1242,17 @@ public void AddKeyReference(
1216
1242
if ( emitCustomEvent == null )
1217
1243
emitCustomEvent = ( rf ) => { this . AddDiaryEntry ( rf , new DiaryEntryStructChange ( ) ) ; } ;
1218
1244
1245
+ // some hints
1246
+ this . AddHintBubble (
1247
+ view , hintMode ,
1248
+ new [ ] {
1249
+ new HintCheck (
1250
+ ( ) => refkeys != null && refkeys . IsValid ( ) != true ,
1251
+ "According to the specification, an existing list of elements shall contain " +
1252
+ "at least one element and for each element all mandatory fields shall be " +
1253
+ "not empty." )
1254
+ } ) ;
1255
+
1219
1256
//
1220
1257
// extended Front panel
1221
1258
//
0 commit comments