cancel
Showing results for 
Search instead for 
Did you mean: 

Report Message in Getter Method for 0ByteResource

Former Member
0 Kudos

HI,

In my application there is a filedownload element with a 0ByteResource at the start. I provide the file with a getter method for the input stream. This works fine, but I want add some warning messages in some cases. But the Messages I want to print with the Message Manager are not displayed when the user downloads the file. The messages occur only at the next roundtrip.

Is there a way to "flush" to messages on the screen when to user starts the download?

Can I start a roundtrip from the application?

Here is my code:


<b>public</b> com.sap.tc.webdynpro.progmodel.api.IWDInputStream getPdfToDownloadResourceInputStream(IPrivateCrmBlattOnline.IPdfToDownloadElement element)
  {
    //@@begin getPdfToDownloadResourceInputStream 
      wdComponentAPI.getMessageManager().reportSuccess(&quot;test message&quot;);
      <b>return</b> WDResourceFactory.createInputStream(this.generatePDF().toByteArray());
    //@@end
  }

Best regards,

Peter

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi

You can start roundtrip by triggering any event ,

workaround for this is could be : without using message manager API display your information with warning /success Image.

or

Simply implement the thread with process indicater will give you the real time customize information.

Best Regards

Satish Kumar

Former Member
0 Kudos

HI,

thanks for your answer, but somehow this doesn't work.

I have this code:


 public com.sap.tc.webdynpro.progmodel.api.IWDInputStream getPdfToDownloadResourceInputStream(IPrivateCrmBlattOnline.IPdfToDownloadElement element)
  {
    //@@begin getPdfToDownloadResourceInputStream
           wdComponentAPI.getMessageManager().reportSuccess("test message");
          wdThis.wdFireEventPdfDownloadForced();
          return WDResourceFactory.createInputStream(this.generatePDF().toByteArray());
      
    //@@end
  }

But the messages are not displayed. I also have tried to use a context attribute for the message, but this is not updated until I do a right click on the view or something. that starts a roundtrip.

Have I done something wrong?

Best regards,

Peter

Former Member
0 Kudos

Closed because no solution was found