Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Complete
-
1.2.1.RELEASE
Description
Simple script:
project --projectName prototype --topLevelPackage com.roo.bug
jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity jpa --class ~.domain.Paper --equals
field string --fieldName title
field file --fieldName printableFile --contentType TXT
web jsf setup
web jsf all --package ~.web
Run the application, then:
- Add a "Paper" with some name.
- Add a second Paper with some other name and an attached TXT file.
- List the Papers and open the one without a file; it won't show you a download link, which is correct.
- Open the second Paper, and there also won't be a download link, which is incorrect.
After a little bit of debugging, I pinpointed the cause. The method PaperBean.getViewPanelGrid caches an HtmlPanelGrid object. Line 242 of PaperBean.populateViewPanel checks whether the attached file exists, and if not, creates a PanelGrid without a download link. That's correct for the first object, since it didn't have an attached file, but the second time, it just uses the cached HtmlPanelGrid that doesn't have a download link.