We are using SAPUI5 1.120 with a Fiori Elements OData V4 application based on RAP but also tested below question with UI versions up to 1.151.
Our application contains a parent entity _Items with a composition association _PackItems. A @UI.lineItem annotation referencing _PackItems.PackType automatically generates a sap.ui.mdc.MultiValueField in the table.
We perform RAP validations and return messages targeting individual fields. All normal scalar properties are correctly highlighted in red by Fiori Elements.
However, when validating that _PackItems must contain at least one entry, we return an error targeting the association:
$Parameter/_it/_Items(...)/_PackItemsThe generated MultiValueField is not highlighted in red.
Questions:
Does Fiori Elements OData V4 support automatic value-state handling for validation messages targeting collection-valued associations?
Is there a specific RAP %element, %path, or OData message target syntax required to associate the error with the generated MultiValueField?
Should the validation message be reported against the parent entity's association or against the child entity's PackType property?
Is this a known limitation of sap.ui.mdc.MultiValueField in SAPUI5?
We would prefer to use standard RAP/Fiori Elements message handling rather than manually setting the generated control's valueState.
Request clarification before answering.
Hello @kristof_desaegera89d83
This is a known limitation in Fiori Elements OData V4. Validation messages targeted at a collection-valued association (_PackItems) are not automatically propagated to the generated sap.ui.mdc.MultiValueField
try,
Report the validation against a specific child field (e.g., PackItems-PackType) instead of the association.
If the error is at least one entry required use a parent-level message (page/object level)
Automatic red highlighting of MultiValueField for association-targeted RAP messages is generally not supported in current SAPUI5/Fiori Elements versions
Thanks,
Sravan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Sravan, thank you for your response.
I was already thinking in this direction, but posted to verify. For now, I put the message indeed on the parent element, showing a popup. Still it's a bit confusing for the user to see all input fields in red, and the multivalue one not.
I did however already write some custom code that could filter out the specific message, and find the binded element myself.
This way I could set the UI element validation myself.
I did have some issues on resetting the validation when a user enters new data. Do you have any tips on resetting the state using oData v4 binding?
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.