Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0-M7
-
None
Description
There is two method to access key value in ComponentHintKey according to the getKey() method: accessing the component directly if exists, or the componentProvider. But componentProvider is transient: after the serialization/deserialization cycle it can not be accessed, causing NullPointerException in getKey(). (Wicket viewer caches the page, so serialization is a must)
Solution: gain access to the component directly on serialization:
private void writeObject(ObjectOutputStream oos) throws IOException { if (componentProvider != null && component == null) { try { component = componentProvider.get(); } catch (Exception ignored) { // Maybe some log is necessary or throw the error } } oos.defaultWriteObject(); }
Attachments
Issue Links
- Is contained by
-
CAUSEWAY-3005 [Wicket Viewer] DataRowToggle might throw after issuing a Blob Download
- Closed