Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Complete
    • Affects Version/s: 1.2.1.RELEASE
    • Fix Version/s: 1.2.2.RELEASE
    • Component/s: JSF
    • Labels:

      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:

      1. Add a "Paper" with some name.
      2. Add a second Paper with some other name and an attached TXT file.
      3. List the Papers and open the one without a file; it won't show you a download link, which is correct.
      4. 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.

        Attachments

          Activity

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              mc MC
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: