Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)
Just to complete discussion, right click on link didn't work with AjaxDownload version. Regards, Igor 2011/8/24 Igor Racic igor.ra...@gmail.com Works by using AttributeModifier for href. Any objection to use it with AjaxLink ? Thank you and regards, Igor 2011/8/24 Igor Racic igor.ra...@gmail.com Hi, It worked in IE7. FF/Chrome option setting to download in fixed directory played here. I changed to ask on every download and now it works (both ways !). Is there a way so that right click propose correct name (currenctly it's like xyz.htm / xyz.htm.part) ? Thank you and regards, Igor 2011/8/23 eugenebalt eugeneb...@yahoo.com Igor, Don't use the AJAXDownload class. There's another way to do it via Ajax, and get the Save As dialog. Click this page: https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html Go down to the example that starts with or do it like this: (the 2nd example in the section Starting download after form submission (Wicket 1.2)) This example is using the WebResource. [ WebResource export = new WebResource() { ... etc. ] Use this WebResource example. Then, add a ResourceLink backed by this WebResource. I followed it directly and it works. I get the Save As... dialog box and the file bytes are constructed at the time the link is clicked. CODE: -- // Export to Spreadsheet Link // 1. Construct a WebResource from Excel bytes WebResource export = new WebResource() { @Override public IResourceStream getResourceStream() { ByteArrayResource bar = new ByteArrayResource(application/vnd.ms-excel, createExcelBytes()); return bar.getResourceStream(); } @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader(report.xls); } }; export.setCacheable(false); // 2. Add a ResourceLink based on the WebResource ResourceLink exportLink = new ResourceLink(exportLink, export); add(exportLink); -- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)
Hi, It worked in IE7. FF/Chrome option setting to download in fixed directory played here. I changed to ask on every download and now it works (both ways !). Is there a way so that right click propose correct name (currenctly it's like xyz.htm / xyz.htm.part) ? Thank you and regards, Igor 2011/8/23 eugenebalt eugeneb...@yahoo.com Igor, Don't use the AJAXDownload class. There's another way to do it via Ajax, and get the Save As dialog. Click this page: https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html Go down to the example that starts with or do it like this: (the 2nd example in the section Starting download after form submission (Wicket 1.2)) This example is using the WebResource. [ WebResource export = new WebResource() { ... etc. ] Use this WebResource example. Then, add a ResourceLink backed by this WebResource. I followed it directly and it works. I get the Save As... dialog box and the file bytes are constructed at the time the link is clicked. CODE: -- // Export to Spreadsheet Link // 1. Construct a WebResource from Excel bytes WebResource export = new WebResource() { @Override public IResourceStream getResourceStream() { ByteArrayResource bar = new ByteArrayResource(application/vnd.ms-excel, createExcelBytes()); return bar.getResourceStream(); } @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader(report.xls); } }; export.setCacheable(false); // 2. Add a ResourceLink based on the WebResource ResourceLink exportLink = new ResourceLink(exportLink, export); add(exportLink); -- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)
Works by using AttributeModifier for href. Any objection to use it with AjaxLink ? Thank you and regards, Igor 2011/8/24 Igor Racic igor.ra...@gmail.com Hi, It worked in IE7. FF/Chrome option setting to download in fixed directory played here. I changed to ask on every download and now it works (both ways !). Is there a way so that right click propose correct name (currenctly it's like xyz.htm / xyz.htm.part) ? Thank you and regards, Igor 2011/8/23 eugenebalt eugeneb...@yahoo.com Igor, Don't use the AJAXDownload class. There's another way to do it via Ajax, and get the Save As dialog. Click this page: https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html Go down to the example that starts with or do it like this: (the 2nd example in the section Starting download after form submission (Wicket 1.2)) This example is using the WebResource. [ WebResource export = new WebResource() { ... etc. ] Use this WebResource example. Then, add a ResourceLink backed by this WebResource. I followed it directly and it works. I get the Save As... dialog box and the file bytes are constructed at the time the link is clicked. CODE: -- // Export to Spreadsheet Link // 1. Construct a WebResource from Excel bytes WebResource export = new WebResource() { @Override public IResourceStream getResourceStream() { ByteArrayResource bar = new ByteArrayResource(application/vnd.ms-excel, createExcelBytes()); return bar.getResourceStream(); } @Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.setAttachmentHeader(report.xls); } }; export.setCacheable(false); // 2. Add a ResourceLink based on the WebResource ResourceLink exportLink = new ResourceLink(exportLink, export); add(exportLink); -- -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3763726.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)
Hi, I am not able to get save dialog. Here is the code: final AJAXDownload download = new AJAXDownload() { @Override protected IResourceStream getResourceStream() { return new StringResourceStream(info.srcString, text/plain); } @Override protected String getFileName() { return info.proposedFileName; } }; add(download); add(new AjaxLinkVoid(download) { @Override public void onClick(AjaxRequestTarget target) { // do whatever with the target, e.g. refresh components //target.addComponent(...); // finally initiate the download download.initiate(target); } }); Any hint to troubleshoot the problem ? (Clicking on link goes directly to download) Version is 1.4.17 Thank you and regards, Igor 2011/8/22 eugenebalt eugeneb...@yahoo.com Thanks I fixed it. This example explains how to do it. https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3760552.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AJAXDownload Example Doesn't Support Content-Disposition (Save As)
Yes, it initialized. Thank you, Igor 2011/8/23 Sven Meier s...@meiers.net Hi, are you sure proposedFileName is non-null? Sven On 08/23/2011 07:29 PM, Igor Racic wrote: Hi, I am not able to get save dialog. Here is the code: final AJAXDownload download = new AJAXDownload() { @Override protected IResourceStream getResourceStream() { return new StringResourceStream(info.srcString, text/plain); } @Override protected String getFileName() { return info.proposedFileName; } }; add(download); add(new AjaxLinkVoid(download) { @Override public void onClick(AjaxRequestTarget target) { // do whatever with the target, e.g. refresh components //target.addComponent(...); // finally initiate the download download.initiate(target); } }); Any hint to troubleshoot the problem ? (Clicking on link goes directly to download) Version is 1.4.17 Thank you and regards, Igor 2011/8/22 eugenebalt eugeneb...@yahoo.com Thanks I fixed it. This example explains how to do it. https://cwiki.apache.org/WICKET/best-practices-and-gotchas.html -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AJAXDownload-Example-Doesn-t-Support-Content-Disposition-Save-As-tp3760342p3760552.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: New Wicket tutorial series
Hi, Thank you for tutorials. Someone with less knowledge (like me :-) can find them useful. I think it would be easier to follow tutorials if it were made by something like wink (especially where you have longer code with 6-7 points that are referenced) But, I can understand that it would be much less SEO friendly... One thing that comes regularly - some getting started Authentication Authorization ? Thank you and regards, Igor 2011/3/14 Tomasz Dziurko tdziu...@gmail.com But maybe some hints what could be improved/added/changed :) I would be happy for any of these kind of comments. -- Best regards, Tomasz Dziurko http://www.programatico.pl/
Re: GIcon URL
Hi, Thank you Jeremy, urlFor was missing ingredient. Regards, Igor 2010/12/20 Jeremy Thomerson jer...@wickettraining.com Have you tried new GIcon(urlFor(new ResourceReference(SomeClass.class, path-to-img-relative-to-class.jpg))); On Sun, Dec 19, 2010 at 4:41 AM, Igor Racic igor.ra...@gmail.com wrote: Hi, That must be something simple. GIcon (from GMap2) have constructor GIcon (String) which works OK when I put URL of some external icon. How to do it when Icon is inside wicket ? I thought about resources but didn't come with something that works. Thank you and regards, Igor -- Jeremy Thomerson http://wickettraining.com Need a CMS for Wicket? Use Brix! http://brixcms.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
GIcon URL
Hi, That must be something simple. GIcon (from GMap2) have constructor GIcon (String) which works OK when I put URL of some external icon. How to do it when Icon is inside wicket ? I thought about resources but didn't come with something that works. Thank you and regards, Igor
Re: [announce] better look modern css for wicket examples contest
Hi, http://www.cafepress.com/apachewicket.317298148 Just as info, not related to thread - when you change to EURO price is still in $ (at least on FF 3.0.15) Regards, Igor 2010/2/2 nino martinez wael nino.martinez.w...@gmail.com Hi Someone mentioned that we could have a better look feel for wicket, since there are no designers in the core team. I proposed a contest, to make the coolest slickest css for wicket. So please feel free to apply. Requirements: your css should be compatible with the basic browsers, Firefox , IE , Safari etc. And retain heavy use of embedded js. And it should be a drop on, using existing id's hierachy for design. Practical info: The contest ends in 2 months April 2nd. Get the wicket examples here: http://svn.apache.org/repos/asf/wicket/trunk/wicket-examples/ If you need it you can put your css in svn at wicketstuff, write to this list for details on howto get commit rights, you should add your css to sandbox and sf user name ( https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/sandbox/ ). Yes as with all contest there is a prize, you can win the wicket t-shir along with the honor if your css are the winner. This http://www.cafepress.com/apachewicket.317298148 or this http://www.cafepress.com/apachewicket.317298083 depending on your age :) Just reply to this thread to enter the contest. Regards Nino on behalf of the Wicket People
Re: datagrid error
Hi, Yes, that solved the issue. Thank you, Igor 2010/1/6 Matej Knopp matej.kn...@gmail.com Caused by: java.util.MissingResourceException: Unable to find property: 'id1' for component: grid1:header:header:id1 You are missing property id1 for column header in your property file. -Matej On Wed, Jan 6, 2010 at 6:35 PM, Igor Racic igor.ra...@gmail.com wrote: Hi, I am trying to adapt datagrid example and can't resolve following: ERROR - RequestCycle - Exception in rendering component: [Component id = id1] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [Component id = id1] at org.apache.wicket.Component.renderComponent(Component.java:2658) at org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62) at org.apache.wicket.Component.render(Component.java:2450) at com.inmethod.grid.common.ColumnsHeaderRepeater.onRender(ColumnsHeaderRepeater.java:142) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:675) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:114) at org.apache.wicket.Component.renderComponent(Component.java:2619) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:675) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:114) at org.apache.wicket.Component.renderComponent(Component.java:2619) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) at org.apache.wicket.Page.onRender(Page.java:1545) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.Page.renderPage(Page.java:914) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:295) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) Caused by: java.util.MissingResourceException: Unable to find property: 'id1' for component: grid1:header:header:id1 [class=com.inmethod.grid.column.AbstractColumn$1] at org.apache.wicket.Localizer.getString(Localizer.java:344) at org.apache.wicket.Localizer.getString(Localizer.java:138) at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:125) at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:92
datagrid error
Hi, I am trying to adapt datagrid example and can't resolve following: ERROR - RequestCycle - Exception in rendering component: [Component id = id1] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [Component id = id1] at org.apache.wicket.Component.renderComponent(Component.java:2658) at org.apache.wicket.markup.html.WebComponent.onRender(WebComponent.java:62) at org.apache.wicket.Component.render(Component.java:2450) at com.inmethod.grid.common.ColumnsHeaderRepeater.onRender(ColumnsHeaderRepeater.java:142) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:675) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:114) at org.apache.wicket.Component.renderComponent(Component.java:2619) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577) at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:675) at org.apache.wicket.markup.html.panel.Panel.onComponentTagBody(Panel.java:114) at org.apache.wicket.Component.renderComponent(Component.java:2619) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) at org.apache.wicket.Page.onRender(Page.java:1545) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.Page.renderPage(Page.java:914) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:295) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:503) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:827) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:511) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:210) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:379) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) Caused by: java.util.MissingResourceException: Unable to find property: 'id1' for component: grid1:header:header:id1 [class=com.inmethod.grid.column.AbstractColumn$1] at org.apache.wicket.Localizer.getString(Localizer.java:344) at org.apache.wicket.Localizer.getString(Localizer.java:138) at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:125) at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:92) at org.apache.wicket.Component.getDefaultModelObject(Component.java:1657) at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1676) at org.apache.wicket.markup.html.basic.Label.onComponentTagBody(Label.java:114) at org.apache.wicket.Component.renderComponent(Component.java:2619) ... 46 more INFO - ServerAndClientTimeFilter - 1391ms server time taken for request response size: 9967 public HomePage_Grid() { ListIGridColumn columns = new ArrayListIGridColumn();