OK it's all ok i just move the code from the onclick to "onmousedown" AjaxFormSubmitBehavior.
and now all work fine! a big thank Jonas! Luca 2009/3/5 Luca Provenzani <[email protected]> > sorry i wrote a wrong thing... > the result is NOT ever the same, but is the report with the previous > parameters. > I try to explain better: > i've a form that determines the report's prameters. On ResourceLink, i > added a "onmousedown" AjaxFormSubmitBehavior to submit the parameter and > calculate other. Then into the onclick of ResourceLink i update th resource > parameter. > > the source: > > * rXlsLnk = new ResourceLink("lnkReport", xlsResource){ > private static final long serialVersionUID = 1L; > > @Override > public void onClick() { > HashMap<String, String> par = new HashMap<String, > String>(); > par.put("myWhere", myWhere); > > xlsResource.setReportParameters(par); > > super.onClick(); > } > > > > }; > > > > rXlsLnk.add(new AjaxFormSubmitBehavior("onmousedown") { > private static final long serialVersionUID = 1L; > > @Override > protected void onSubmit(AjaxRequestTarget target) { > myWhere = "WHERE > iscr.SISSIONE_COD_SCUOLA='"+MySession.getSessesion().getOperatore().getSissioneScuole().getCodMec()+"'" > + > " AND iscr.FS_ISCR_AS='"+iscrFilter.getAnnoScolastico()+"' > "; > > if(iscrFilter.getPlessoId()!=null && > !iscrFilter.getPlessoId().equals("-1")) > ... > etc etc > .... > } > else > { > } > } > } > > @Override > protected void onError(AjaxRequestTarget target) { > myWhere = "WHERE 1=0"; > target.addComponent(feedbackPanel); > } > });* > > The first time i download the report i obtain an empty report, because > empty parameters. The second time i obtained the report with th first submit > parameter end then and then... > > can you help? > > thanks a lot > > > Luca > > > 2009/3/5 Jonas <[email protected]> > >> If it is the browser that caches the report, you can work around this >> by adding something random to the url generated >> by ResourceLink#getUrl, similar to what's done in NonCachingImage. >> >> urlFor(IResourceListener.INTERFACE) + "&wicket:antiCache=" + >> System.currentTimeMillis() >> >> Unfortunatly, ResourceLink#getUrl is final, so you'll probably have to >> create >> your own Link subclass similar to ResourceLink >> >> On Thu, Mar 5, 2009 at 4:33 PM, Luca Provenzani <[email protected]> >> wrote: >> > in this way it works, but how can i refresh the report when parameter is >> > changed? >> > >> > Until now i change parameter into the onclick of the ResourceLink, but >> now >> > the resource is cached...and then the result report is ever the same.. >> > >> > thanks >> > Luca >> > >> > 2009/3/5 Jonas <[email protected]> >> > >> >> Does it work if you set your Resource setCacheable(true)? >> >> >> >> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <[email protected]> >> >> wrote: >> >> > Hi all >> >> > >> >> > This is my situation: >> >> > i've a ResourceLink based on a JasperReport >> Resource(DynamicWebResource >> >> ) >> >> > and all is ok until i use http. >> >> > But if the web server uses https IE can't download the file. >> >> > >> >> > i searched in the web but i 've found only an e-mail with similar >> problem >> >> ( >> >> > >> http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760), >> >> > but no answer! >> >> > >> >> > Someone can help? >> >> > >> >> > Regards >> >> > >> >> > Luca >> >> > >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [email protected] >> >> For additional commands, e-mail: [email protected] >> >> >> >> >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >
