enhancement
major
defect
major
minor
major
#29701
TL Views: a form shown again after its sidebar section or tab was hidden keeps the values it had when hidden; a reload renders the stale values again
Problem
A <form> over a persistent object listens to changes of that object only while it is attached. FormControl.onDetach() removes the model listener, onAttach() adds it again (com.top_logic.layout.view/.../form/FormControl.java, onAttach/`onDetach`/`registerModelListener`), but nothing catches up with the changes committed while the control was detached. The form therefore shows the values it had when it was hidden until the object changes again while it is displayed.
ReactSidebarControl.selectItem/`displayItem` detaches the content of a sidebar section when another section is selected and keeps it for re-use, which exposes the gap. A browser reload does not heal it: ViewServlet.displayWindow renders the control tree the window already holds (renderAgain), stale form state included.
Tables do not have the problem: RowSourceObserver.attach() calls catchUp(), and command executability is re-evaluated on attach. So on the same page the ticket list and the commands are current while the form beside them is not.
Reproduction in the TL Development app (snapshot build 43, one tab, logged in):
- Sidebar Tickets → open ticket PROBE-27936 (status "New").
- Sidebar Projects → the project → Tickets tab → the same ticket → Accept. The project's ticket page shows "Accepted".
- Sidebar Tickets: the ticket page still shows status "New" (the Accept command is already gone).
- Reload: still "New". A second tab shows "Accepted".
Expected
A form catches up on attach like RowSourceObserver does: in view mode it re-reads its object (or refreshes if the object changed since detach, e.g. by comparing the revision it last displayed); in edit mode it applies the same rule as for a change arriving while attached (#29667). A deleted object is handled as on a live delete event.
Lösung
Ein FormControl, das nach einem Detach wieder angezeigt wird (Resume), behandelt den dargestellten Stand wie RowSourceObserver als unbekannt und aktualisiert sich bedingungslos – ohne Revisionsvergleich, da ein Formular auch Werte anderer Objekte (Referenzen, abgeleitete Werte) zeigen kann, deren Änderungen ein Vergleich der Objektrevision nicht erfasst:
- Objekt gelöscht (nicht mehr gültig) → wie bei einem Live-Löschereignis (kein Modell mehr, Edit-Session verworfen).
- Edit-Modus → dieselbe Regel wie bei einer Live-Änderung (#29667): gespeicherte Werte erscheinen dort, wo der Benutzer nichts geändert hat; seine Änderungen bleiben im Overlay.
- Anzeigemodus → das Formular liest sein Objekt neu.
Das erste Attach nach dem Aufbau bleibt still.
Nebenbei: handleInputChanged registrierte den Model-Listener auch im abgehängten Zustand (und beim nächsten Attach ein zweites Mal); der Listener wird jetzt nur im angehängten Zustand registriert.