Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4415

pdfviewer ignores initial content media

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.0.0
    • Freshly, 9.0.0
    • Components
    • Security Level: Jimmy

      Steps to Reproduce

      <div>
          <zscript>
              import java.net.URL;
              import org.zkoss.util.media.AMedia;
              public AMedia loadPdf() {
                  return new AMedia(application.getResource(execution.toAbsoluteURI("test.pdf", true)), null, null);
              }
              AMedia document = loadPdf();
          </zscript>
          pdfviewer is ignoring the content media initially
          <pdfviewer id="pdf" content="${document}"/>
          <button label="dynamic content via zkau works" onClick="pdf.setContent(loadPdf());"/>
      </div>
      

      Current Result

      the pdfview component doesn't load the content from the initial AMedia
      only setting the content later has an effect

      Expected Result

      the media content should load initially

      Debug Information

      the initial content is not handled during Pdfviewer.renderProperties

      Workaround

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                3h
                Logged:
                Time Spent - 1 hour Remaining Estimate - 3 hours
                1h