wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Celia Xu <wwx....@gmail.com>
Subject Re: How to disable ByteArrayResource cache?
Date Wed, 30 Jan 2013 17:37:39 GMT
Thanks for reply.
But it did not solve the problem.
After manually cleared browser's cache. the pdf's popup window doesn't show
any data whereas the excel file only write first tab's data.

My webpage's structure as shown in the image.
<http://apache-wicket.1842946.n4.nabble.com/file/n4655935/untitled.jpg> 
Panel's constructors and method:
public Panel(String id){
	this(id,null);
}
public Panel(String id, final PageParameters pageParameters) {
	super(id);
...
	add(new TabbedPanel("tabs", this.newTabList(pageParameters,tabValue)));
}
private List<ITab> newTabList(final PageParameters pageParameters, String
tabValue) {
	List<ITab> tabs = new ArrayList<ITab>();
	tabs.add(new AjaxTab("tabValue") {
		private static final long serialVersionUID = 1L;
		@Override
		public WebMarkupContainer getLazyPanel(String panelId) {
			return new AlcoPreviewPanel(panelId, pageParameters,tabValue);}} 
		return tabs;}
====================
in my TabbedPanel:
ByteArrayResource pdfRes =  new
ByteArrayResource("application/pdf",myService.getPDF(){
	@Override
	protected void configureResponse(ResourceResponse response,Attributes
attributes) {
	response.setCacheDuration(Duration.NONE);
	};};
ByteArrayResource excRes =  new
ByteArrayResource({"application/vnd.ms-excel",myService.getEXC(){
	@Override
	protected void configureResponse(ResourceResponse response,Attributes
attributes) {
	response.setCacheDuration(Duration.NONE);
	};}
PopupSettings popupSettings = new PopupSettings(FILENAME,
PopupSettings.RESIZABLE|
PopupSettings.SCROLLBARS).setHeight(500).setWidth(700);
ResourceLink pdfLink = (ResourceLink) new ResourceLink("pdfLink", pdfRes);
pdfLink.setPopupSettings(popupSettings); 
ResourceLink excLink = (ResourceLink) new ResourceLink("excLink", excRes);

// to open the link, i'm using ajaxbuttons to trigger:
AjaxButton btn2 = new AjaxButton ("generateEXC", new
Model<String>("Report"), "reportBody") {
	@Override
	protected void onSubmit(AjaxRequestTarget target, Form form) {
	   
target.appendJavaScript("document.getElementById('excLink').click()");}};

I also dynamically generated file's name
Any Idea?
Thanks



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-disable-ByteArrayResource-cache-tp4655897p4655935.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message