• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Printing dynamic WOImage with IE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing dynamic WOImage with IE


  • Subject: Re: Printing dynamic WOImage with IE
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 15 Aug 2007 21:55:08 -0700


On Aug 15, 2007, at 9:02 PM, Jacob Mouka wrote:

I vaguely remember running into this. I can't test it (no IE access at the moment) but my old component has a name bound to the WOImage's key attribute. I used a random number (eg 123.png) so that the cache would be refreshed when the image gets updated. Chuck's suggestion might work too, but if it doesn't, give this a try. If I understand it correctly, if you don't bind the key attribute then the image has to be re-fetched each time the page loads, and I guess IE goes back to the source instead of looking in its cache for printing.

A caution on this. See the docs for WOResourceManager.setData:

By default when a dynamic element requests an image from the database, or builds a graph on the fly, it tells the resource manager to store its data in a cache, using either a developer- specified key, or a random key. In return the dynamic element inserts a special url in the HTML so that the browser, on callback, can retrieve the data out of the resource manager cache and display it. If the key was specified by the component, the data stays in the cache as long as the cache is not flushed. If the key was randomly generated by the resource manager, the data is removed from the cache (using removeDataForKey), as soon as the browser retrieves it.
I read this as meaning that if you specify a key, you are responsible for removing it from the cache (which I suspect is not easy to do at the right time). If you don't do this you run the risk of running out of memory.

Chuck





On 14-Aug-07, at 11:39 AM, Chuck Hill wrote:


On Aug 14, 2007, at 7:35 AM, Frederic JECKER wrote:

Hi list,

I'm using a WOImage to print charts generated by JFreeChart.
This works fine and the generated charts are displayed on the browsers.
Now when I try to print my page with IE (this works well) the generated pictures are not printed.
I googled for a while without success, I just found some posts mentionning cache/content-type issues :
if they are not set correctly IE performs a refresh of the picture before printing (which is the cause of my problem)
I checked my page for a pragma no-cache in the header and set a correct mime time in the WOImage bindings without success.


Anyone could help me with this issue ?

Here is one way. This goes in Application.java


// Revert to 4.5 behaviour. Having this enabled prevents IE from displaying content that cannot
// be displayed inline in the browswer (pdf files, for example). This was a known bug in IE 4.0
// and is reported fixed by MS: http:// support.microsoft.com/support/kb/articles/Q231/2/96.ASP?LN=EN- US&SD=gn&FR=0&qry=Internet Explorer cannot% 20download&rnk=19&src=DHCS_MSPSS_gn_SRCH&SPR=IE
// "When you try to download a .pdf file from a Web site that uses the Hypertext Transfer Protocol
// (HTTP) "Cache-Control = 'no-cache'" directive, Internet Explorer may generate the following
// error message: Internet Explorer cannot down load from the Internet site File_name from
// Computer_name.".
setPageRefreshOnBacktrackEnabled(false);



Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net


This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Printing dynamic WOImage with IE (From: Frederic JECKER <email@hidden>)
 >Re: Printing dynamic WOImage with IE (From: Chuck Hill <email@hidden>)
 >Re: Printing dynamic WOImage with IE (From: Jacob Mouka <email@hidden>)

  • Prev by Date: Re: Which way is more efficient to get particular EOEnterpriseObject
  • Next by Date: Re: Which way is more efficient to get particular EOEnterpriseObject
  • Previous by thread: Re: Printing dynamic WOImage with IE
  • Next by thread: WO 5.3 Deployment on Windows
  • Index(es):
    • Date
    • Thread