Ticket #332 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Store invalid values (Ontology, Stringlist, Date) in wizardError variable

Reported by: t.w.abma@… Owned by: t.w.abma@…
Priority: major Milestone: 0.7.0
Component: Core Functionality Version:
Keywords: Cc:
Product: Operating system:
URL: Hardware:

Description

Currently when I set values in an entity like an ontology, stringlist or date value which doesn't fit, it doesn't get stored in the entity. I have a separate map which keeps track of these failed values and I have some JS to update the table editor with these missing values.

Because I am reading directly from Excel and try to put all values in the entity, I will somehow lose the original values if the cannot be set and they also won't be shown in the table editor.

Have talked with Jeroen about this. If the "original" values which cannot be set with setFieldValue() could be put in the wizardError variable then the table editor could retrieve the failed values from the wizardError variable and just put them in the cells, but with a red box or "invalid: value" message in them.

Change History

Changed 3 years ago by work@…

  • status changed from new to assigned
  • owner changed from work@… to t.w.abma@…

Actually, it can't be put in the wizardError variable as that one specifically is filled by GORM's validation, and that should not change. The validate method is the only method which should be used for validation / error feedback. setFieldValue cannot be trusted, as it will allow values which will not pass validation...

Of course we can improve setFieldValue to somehow append a map with troublesome setters, but you cannot rely on that to be 100% accurate...

Changed 3 years ago by business@…

  • milestone set to 0.7.0

Please document solution

Changed 3 years ago by t.w.abma@…

  • status changed from assigned to closed
  • resolution set to fixed

Is solved by returning an errorList when using the getDatamatrixAsEntityList(...)-method. This method returns a list of entities read and a list of fields which could not be stored in the entity. The errors in the list is in the format [entity: "entity_11231_name, originalValue: value].

This errorList is "globally" available via the flow scope and is used in the table editor validation step to show the failed fields and the original value.

Note: See TracTickets for help on using tickets.