Skip to content

Stateless Frontend Does Not Detect Changes in Hidden Expression When Datamodel Is Updated in ProcessDataRead #1414

Description

@erlehaak

Description of the bug

In a stateless Altinn application, the frontend fails to detect changes in hidden expressions for components when updates are made to the data model in the ProcessDataRead method of IDataProcessor when a new List also is added to the datamodel. This issue occurs unless AltinnRowID is manually added to lists in the data model, even when the field referenced in the hidden expression is not part of the list. This behavior is unexpected and limits the functionality of hidden expressions in stateless applications.

Example of fix in ProcessDataRead

{
    garantiInformasjon = new GarantiInformasjon
   {
       transportorOrgnummer = "311193473", <--- Field used in hidden logic
       andreGarantister = new List<AnnenGarantist>
       {
           new AnnenGarantist
           {
               navn = "testorg",
               status = "AKTIV",
               AltinnRowId = Guid.NewGuid() <--- Must be included for hidden logic to work
           }
       },
       egneGarantier = new List<Garanti>
       {
           new Garanti
           {
               garantitype = "GODS",
               status = "AKTIV",
               AltinnRowId = Guid.NewGuid() <--- Must be included for hidden logic to work
           }
       }
   }
}
garantist.transportor = transportor;

Steps To Reproduce

  1. Create a stateless Altinn application with a component being hidden based on a datamodel field
  2. In IDataProcessor.ProcessDataRead change the status of the field in the expression
  3. In IDataProcessor.ProcessDataRead initialize a new List without AltinnRowId specified
  4. Observe that the frontend does not detect changes in the hidden field.

Additional Information

App affected by bug:

Statless layout - Component line 84:

ProcessDataRead

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions