Re: Unit Testing AjaxTabbedPanel
Hi, AjaxTabbedPanel uses JavaScript (Ajax) to switch from tab to tab. You can simulate this in WicketTester by calling the Ajax behaviors directly. See http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java?view=markuppathrev=1221291 method #testRestartMethod() to see how we do that for AbstractAjaxTimerBehavior. Also take a look at org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanelTester to see how AjaxLazyLoadPanel is tested. On Tue, Dec 20, 2011 at 11:38 PM, sudeivas sureshkumar@gmail.com wrote: Hello All, I am using AjaxTabbedPanel in my application and I want to write unit tests for that. But I couldn't find any example tests in Apache Wicket - 1.5.3 code. Please share any sample code to write unit tests for AjaxTabbedPanel. Thanks, Suresh -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Unit-Testing-AjaxTabbedPanel-tp4219476p4219476.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting response from a external URL
The problem with EmptyRequestHandler is that the previous response is reset and an empty is written to the client. There are several solutions for your problem: 1) use a IResource instead of a Page. You don't use components anyway. See wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ for more info. 2) Use a WebPage that implements org.apache.wicket.markup.IMarkupResourceStreamProvider and org.apache.wicket.markup.IMarkupCacheKeyProvider The first interface is needed to generate the markup dynamically. E.g. : return new StringResourceStream(yourDataReturnedFromHttpClient) The second should return null in #getCacheKey() to not cache the result from the first. I.e. Wicket will ask IMarkupCacheKeyProvider for new data for each request. 3) Do what Igor suggested with EmptyRequestHandler but use TextRequestHandler(yourDataReturnedFromHttpClient) instead. On Tue, Dec 20, 2011 at 10:11 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote: what is the stack trace look like now? also, no need to extend a webpage, why not just impplement IRequestHandler directly and mount it somewhere so you can construct urls to it... -igor On Tue, Dec 20, 2011 at 11:24 AM, Pablo Díaz inspd...@gmail.com wrote: I've done that, but I get the same result :( El 20/12/11 20:18, Igor Vaynberg escribió: (httpservletresponse)getresponse().getcontainerresponse() -igor On Tue, Dec 20, 2011 at 10:58 AM, Pablo Díazinspd...@gmail.com wrote: Ok, but How I can get the httpservletresponse object to write in it? I'm extending the WebPage class ... El 20/12/11 19:26, Igor Vaynberg escribió: try writing directly into httpservletresponse instead of wicket's response. there is a bug fix for this in the upcoming release -igor On Tue, Dec 20, 2011 at 10:03 AM, Pablo Díazinspd...@gmail.com wrote: Ok, thank you, I'm not getting the error if I use your code, but I'm not able to gets the response (I always get a blank image, when I must get a map). I mean, I only like getting the request done from someone and check if he has enough privileges to do some operation Then, I change some parameters depends on his role he can. My code is like this: public class ProxyAction extends WebPage { public ProxyAction(PageParameters parameters){ URL url = null; Logger logger = Logger.getLogger(ProxyAction.class); HttpURLConnection con = null; Response response = getResponse(); ByteArrayBuffer bab = new ByteArrayBuffer(); try { String mapserverUrl = http://localhost/cgi-bin/mapserv?mode=mapmap=/var/local/mapserver/inveco/map/client_draw.maplayers=provincias;; IteratorString it = claves.iterator(); while(it.hasNext()){ String clave = (String) it.next(); mapserverUrl= mapserverUrl + + clave+=; ListStringValue valores = parameters.getValues(clave); for(int i=0; ivalores.size(); i++){ mapserverUrl = mapserverUrl+valores.get(i)+ ; } } url = new URL(mapserverUrl); con = (HttpURLConnection) url.openConnection(); InputStream istream = con.getInputStream(); byte[] b = new byte[1]; for(;;){ if(istream.read(b) == -1) break; bab.write(b); } response.write(bab.getRawData()); getRequestCycle().replaceAllRequestHandlers(new EmptyRequestHandler()); } catch (MalformedURLException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } //this.getRequestCycle().setResponse(response); } } El 20/12/11 18:17, Igor Vaynberg escribió: in the future, start with the error :) you have to tell wicket that it should not render the page after you have written the data out... output.write(data); getrequestcycle().replaceallrequesthandlers(new EmptyRequestHandler()); -igor On Tue, Dec 20, 2011 at 8:54 AM, Pablo Díazinspd...@gmail.com wrote: Because when I try to write to response I get's this error: ERROR - DefaultExceptionMapper - Unexpected error occurred java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called. at org.apache.wicket.protocol.http.BufferedWebResponse.write(BufferedWebResponse.java:465) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1525) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638) at org.apache.wicket.Page.onRender(Page.java:904) at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140) at org.apache.wicket.Component.internalRender(Component.java:2347) at org.apache.wicket.Component.render(Component.java:2275) at org.apache.wicket.Page.renderPage(Page.java:1035) at
Wicket 1.5: The component(s) below failed to render
Hello list We built a rendering engine in Wicket 1.4 which takes a UI description from an XML file and builds an HTML representation from that. Everything worked fine in Wicket 1.4.x. Now I tried to switch to Wicket 1.5.3. Without changing anything from the rendering part, I now get this error: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). Below that message I get a list with all components. We mostly use ListViews to build the UI: ListViewObjectBase listView = new ListViewObjectBase(eachGuiElem, formRoot.getChildren()) { @Override protected void populateItem(ListItemObjectBase item) { ObjectBase ob = item.getModelObject(); item.add(new Panel(...)); } }; So here is my question. What did change with Wicket 1.5? How can I make our renderer work again? Where should I look at to find out whats wrong? Thanks, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5: The component(s) below failed to render
Hi, On Wed, Dec 21, 2011 at 11:58 AM, Adrian Wiesmann awiesm...@somap.org wrote: Hello list We built a rendering engine in Wicket 1.4 which takes a UI description from an XML file and builds an HTML representation from that. Everything worked fine in Wicket 1.4.x. Now I tried to switch to Wicket 1.5.3. Without changing anything from the rendering part, I now get this error: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). This error means that Wicket sees these components only in the Java component tree but doesn't see them in the markup tree. How exactly do you pass the generated markup to Wicket ? Below that message I get a list with all components. We mostly use ListViews to build the UI: ListViewObjectBase listView = new ListViewObjectBase(eachGuiElem, formRoot.getChildren()) { @Override protected void populateItem(ListItemObjectBase item) { ObjectBase ob = item.getModelObject(); item.add(new Panel(...)); } }; So here is my question. What did change with Wicket 1.5? How can I make our renderer work again? Where should I look at to find out whats wrong? Thanks, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5: The component(s) below failed to render
On 12/21/11 11:05 AM, Martin Grigorov wrote: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). This error means that Wicket sees these components only in the Java component tree but doesn't see them in the markup tree. How exactly do you pass the generated markup to Wicket ? Let's have a simple example: Simple layout/UI in XML: frame actionbox DataBinding=@Inventory[0] fop-action enabled=true / /actionbox list DataBinding=@Inventory[0] field DataBinding=name/ /list /frame Which is read and converted into an in-memory object tree: frame actionbox fop-action ... This is then taken and Wicket classes are instantiated for every in-memory object. In the constructor of every class (depending on its nature) there is code to build the Wicket based object structure. Something like this: ListViewObjectBase listView = new ListViewObjectBase(eachGuiElem, formRoot.getChildren()) { @Override protected void populateItem(ListItemObjectBase item) { ObjectBase ob = item.getModelObject(); item.add(getPanelFromObjectBase(cell, ob, model, form)); } }; With that html content: ... tr wicket:id=eachGuiElem td style=border:0px;margin:0px;padding:0px; wicket:id=cell/td /tr ... Where getOPanelFromObjectBase contains something like this: protected Panel getPanelFromObjectBase(String id, ObjectBase ob, IModel? model, final Form? form) { if (ob.getClass().equals(GListAndDetail.class)) { return new GWListAndDetail(id, model, (GListAndDetail) ob, form); } else if (ob.getClass().equals(GActionBox.class)) { return new GWActionBox(id, model, (GActionBox) ob, form); } ... All classes starting with GWxxx are subclasses of Wicket Panels. Every GWxxx class has an HTML file with the same name and the ending html in the same directory as the class file. So Wicket should be able to find the right markup. And with the right markup it should be able to render not only the object tree but also the html representation. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5: The component(s) below failed to render
On Wed, Dec 21, 2011 at 12:17 PM, Adrian Wiesmann awiesm...@somap.org wrote: On 12/21/11 11:05 AM, Martin Grigorov wrote: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). This error means that Wicket sees these components only in the Java component tree but doesn't see them in the markup tree. How exactly do you pass the generated markup to Wicket ? Let's have a simple example: Simple layout/UI in XML: frame actionbox DataBinding=@Inventory[0] fop-action enabled=true / /actionbox list DataBinding=@Inventory[0] field DataBinding=name/ /list /frame Which is read and converted into an in-memory object tree: frame actionbox fop-action ... This is then taken and Wicket classes are instantiated for every in-memory object. In the constructor of every class (depending on its nature) there is code to build the Wicket based object structure. Something like this: ListViewObjectBase listView = new ListViewObjectBase(eachGuiElem, formRoot.getChildren()) { @Override protected void populateItem(ListItemObjectBase item) { ObjectBase ob = item.getModelObject(); item.add(getPanelFromObjectBase(cell, ob, model, form)); } }; With that html content: ... tr wicket:id=eachGuiElem td style=border:0px;margin:0px;padding:0px; wicket:id=cell/td /tr ... Where getOPanelFromObjectBase contains something like this: protected Panel getPanelFromObjectBase(String id, ObjectBase ob, IModel? model, final Form? form) { if (ob.getClass().equals(GListAndDetail.class)) { return new GWListAndDetail(id, model, (GListAndDetail) ob, form); } else if (ob.getClass().equals(GActionBox.class)) { return new GWActionBox(id, model, (GActionBox) ob, form); } ... All classes starting with GWxxx are subclasses of Wicket Panels. Every GWxxx class has an HTML file with the same name and the ending html in the same directory as the class file. So Wicket should be able to find the right markup. And with the right markup it should be able to render not only the object tree but also the html representation. All this looks OK. Can you paste the ids of the components which cannot be rendered ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5: The component(s) below failed to render
On 12/21/11 11:23 AM, Martin Grigorov wrote: All this looks OK. Can you paste the ids of the components which cannot be rendered ? You mean this? 1. [Component id = caption] 2. [RepeatingView [Component id = toolbars]] 3. [GWListActionToolbar [Component id = 0]] 4. [AjaxFallbackHeadersToolbar [Component id = 1]] 5. [RepeatingView [Component id = headers]] 6. [AbstractItem [Component id = 1]] 7. [ [Component id = header]] 8. [BorderBodyContainer [Component id = header_body]] 9. [Component id = label] 10. [ [Component id = orderByLink]] 11. [BorderBodyContainer [Component id = header_body]] 12. [Component id = label] 13. [AbstractItem [Component id = 2]] 14. [ [Component id = header]] 15. [BorderBodyContainer [Component id = header_body]] 16. [Component id = label] 17. [ [Component id = orderByLink]] 18. [BorderBodyContainer [Component id = header_body]] 19. [Component id = label] 20. [AbstractItem [Component id = 3]] 21. [ [Component id = header]] 22. [BorderBodyContainer [Component id = header_body]] 23. [Component id = label] 24. [ [Component id = orderByLink]] 25. [BorderBodyContainer [Component id = header_body]] 26. [Component id = label] 27. [AbstractItem [Component id = 4]] 28. [ [Component id = header]] 29. [BorderBodyContainer [Component id = header_body]] 30. [Component id = label] 31. [ [Component id = orderByLink]] 32. [BorderBodyContainer [Component id = header_body]] 33. [Component id = label] 34. [AbstractItem [Component id = 5]] 35. [ [Component id = header]] 36. [BorderBodyContainer [Component id = header_body]] 37. [Component id = label] 38. [ [Component id = orderByLink]] 39. [BorderBodyContainer [Component id = header_body]] 40. [Component id = label] 41. [GWListFilterToolbar [Component id = 2]] 42. [FilterForm [Component id = filterform]] 43. [RepeatingView [Component id = filters]] 44. [WebMarkupContainer [Component id = 1]] 45. [TextFilterEx [Component id = filter]] 46. [TextField [Component id = filter]] 47. [WebMarkupContainer [Component id = 2]] 48. [ChoiceFilter [Component id = filter]] 49. [DropDownChoice [Component id = filter]] 50. [WebMarkupContainer [Component id = 3]] 51. [TextFilterEx [Component id = filter]] 52. [TextField [Component id = filter]] 53. [WebMarkupContainer [Component id = 4]] 54. [NoFilter [Component id = filter]] 55. [WebMarkupContainer [Component id = 5]] 56. [NoFilter [Component id = filter]] 57. [Component id = caption] 58. [RepeatingView [Component id = toolbars]] 59. [GWListActionToolbar [Component id = 5]] 60. [AjaxFallbackHeadersToolbar [Component id = 6]] 61. [RepeatingView [Component id = headers]] 62. [AbstractItem [Component id = 1]] 63. [ [Component id = header]] 64. [BorderBodyContainer [Component id = header_body]] 65. [Component id = label] 66. [ [Component id = orderByLink]] 67. [BorderBodyContainer [Component id = header_body]] 68. [Component id = label] 69. [AbstractItem [Component id = 2]] 70. [ [Component id = header]] 71. [BorderBodyContainer [Component id = header_body]] 72. [Component id = label] 73. [ [Component id = orderByLink]] 74. [BorderBodyContainer [Component id = header_body]] 75. [Component id = label] 76. [AbstractItem [Component id = 3]] 77. [ [Component id = header]] 78. [BorderBodyContainer [Component id = header_body]] 79. [Component id = label] 80. [ [Component id = orderByLink]] 81. [BorderBodyContainer [Component id = header_body]] 82. [Component id = label] 83. [AbstractItem [Component id = 4]] 84. [ [Component id = header]] 85. [BorderBodyContainer [Component id = header_body]] 86. [Component id = label] 87. [ [Component id = orderByLink]] 88. [BorderBodyContainer [Component id = header_body]] 89. [Component id = label] 90. [GWListFilterToolbar [Component id = 7]] 91. [FilterForm [Component id = filterform]] 92. [RepeatingView [Component id = filters]] 93. [WebMarkupContainer [Component id = 1]] 94. [TextFilterEx [Component id = filter]] 95. [TextField [Component id = filter]] 96. [WebMarkupContainer [Component id = 2]] 97. [TextFilterEx [Component id = filter]] 98. [TextField [Component id = filter]] 99. [WebMarkupContainer [Component id = 3]] 100. [TextFilterEx [Component id = filter]] 101. [TextField [Component id = filter]] 102. [WebMarkupContainer [Component id = 4]] 103. [TextFilterEx [Component id = filter]] 104. [TextField [Component id = filter]] - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket 1.5: The component(s) below failed to render
Do you use a border? Because border component assignment changed Cheers Per Am 21.12.2011 10:58, schrieb Adrian Wiesmann: Hello list We built a rendering engine in Wicket 1.4 which takes a UI description from an XML file and builds an HTML representation from that. Everything worked fine in Wicket 1.4.x. Now I tried to switch to Wicket 1.5.3. Without changing anything from the rendering part, I now get this error: org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). Below that message I get a list with all components. We mostly use ListViews to build the UI: ListViewObjectBase listView = new ListViewObjectBase(eachGuiElem, formRoot.getChildren()) { @Override protected void populateItem(ListItemObjectBase item) { ObjectBase ob = item.getModelObject(); item.add(new Panel(...)); } }; So here is my question. What did change with Wicket 1.5? How can I make our renderer work again? Where should I look at to find out whats wrong? Thanks, Adrian - 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
Modal window close behavior - should it hide content?
Hi guys! Using wicket 1.4.18; experiencing a strange behavior. I have a form, modal window in it (we are chaining them). This 'outer' form has its own submit button. The content in modal window does have the form too, with its own validators. So, hierarchy looks like: userForm with submit button - Form (part of the ModalWindow markup) - Form inside modal window content - validator. Issue is that if i open the modal window, fail that validator inside form inside content of MW, and then _close_ modal window, submission of the outermost form fails with the validation of that validator! I did check the stuff, looks like wicket tries to validate it as a nested form, and thus fails. Weird thing is that innermost form is technically not visible on the page, but visible in terms of wicket hierarchy. I looked into the behavior of modal window on close, and it does _not_ hide content however the show() method does setVisible(true) to it. Am i missing something from the picture? Here's MW's close listener (invoked directly from AJAX behavior): protected final void respondOnWindowClosed(AjaxRequestTarget target) { shown = false; // should we cleanup the pagemap? if (deletePageMap == true) { // get the pagemap Session session = Session.get(); IPageMap pageMap = session.pageMapForName(getPageMapName(), false); // if there is any remove it if (pageMap != null) { session.removePageMap(pageMap); deletePageMap = false; } } if (windowClosedCallback != null) { windowClosedCallback.onClose(target); } } Thank you! Regards, -- Alexander Cherednichenko [ the only way out is the way up ]
Re: Wicket 1.5: The component(s) below failed to render
On 12/21/11 11:46 AM, Per Newgro wrote: Do you use a border? Because border component assignment changed No borders. Mostly iterators and plain panels... Cheers, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Firefox : ServletRequest does not contain multipart content
Hello! I have the same situation here. Do you know how to fix it? Thanks!! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Firefox-ServletRequest-does-not-contain-multipart-content-tp3027552p4221601.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: Jquery Problem with Wicket Deployment Mode
2011/12/21 Seçil Aydın techlove...@gmail.com: We have developed a wicket application on development mode but we want to change the mode of the application to deployment mode. When we changed this to deployment mode jquery could not be loaded by the application. Is there any solution to this? What exactly is the problem ? With my best regards. - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4221713.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Jquery Problem with Wicket Deployment Mode
Hi Martin,the problem is: we have a menu moving with jquery functions, these functions could not be executed after this change since they could not be loaded. - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4221741.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: Jquery Problem with Wicket Deployment Mode
what is wrong with the header contribution ? is jquery.js not in headlink href=... at all ? or its path is broken ? or ... 2011/12/21 Seçil Aydın techlove...@gmail.com: Hi Martin,the problem is: we have a menu moving with jquery functions, these functions could not be executed after this change since they could not be loaded. - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4221741.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Jquery Problem with Wicket Deployment Mode
jquery is only included from java code, it is not included from html code It loses context path when calling with deployment mode. Like: Development mode : Server/GUI_NAME/……/jquery.js Deployment mode : Server/……/jquery.js - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4221850.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: Jquery Problem with Wicket Deployment Mode
Try to reproduce the problem in mini application (aka quickstart) and attach it to our Jira 2011/12/21 Seçil Aydın techlove...@gmail.com: jquery is only included from java code, it is not included from html code It loses context path when calling with deployment mode. Like: Development mode : Server/GUI_NAME/……/jquery.js Deployment mode : Server/……/jquery.js - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4221850.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Problem with wicket 1.5.3 and wiquery 1.5.3
hi Hielke We staying with the patch for now, we have to stable our system. but i will check it in few days. Thanks. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-wicket-1-5-3-and-wiquery-1-5-3-tp4217860p4221949.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
Problem with wicketstuff-tinymce-1.5.3 external plugins
We are performing upgrade to wicketstuff-tinymce-1.5.3 and we have some problems with external plugins. this code in tiny_mce_src.js loadScripts() function that suppose to load our plugin javaScript is never called: function loadScripts() { if (s.language s.language_load !== false) sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); if (s.theme s.theme.charAt(0) != '-' !ThemeManager.urls[s.theme]) ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); each(explode(s.plugins), function(p) { if (p !PluginManager.urls[p]) { if (p.charAt(0) == '-') { p = p.substr(1, p.length); var dependencies = PluginManager.dependencies(p); each(dependencies, function(dep) { *var defaultSettings = {prefix:'plugins/', resource: dep, suffix:'/editor_plugin' + tinymce.suffix + '.js'}; var dep = PluginManager.createUrl(defaultSettings, dep); PluginManager.load(dep.resource, dep);* }); } else { // Skip safari plugin, since it is removed as of 3.3b1 if (p == 'safari') { return; } PluginManager.load(p, {prefix:'plugins/', resource: p, suffix:'/editor_plugin' + tinymce.suffix + '.js'}); } } }); we don't have any dependencies on our plugin... do we need some? Any help will be appreciated. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-wicketstuff-tinymce-1-5-3-external-plugins-tp4222060p4222060.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: Jquery Problem with Wicket Deployment Mode
Martin thank you for your response, we will do it. - Wicket-Java -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Jquery-Problem-with-Wicket-Deployment-Mode-tp4221713p4222338.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: Getting response from a external URL
Thank you for your answer but I think this is only correct when you are returning a CharSequence, what's happen when you like returning Image, for example? El 21/12/11 10:33, Martin Grigorov escribió: The problem with EmptyRequestHandler is that the previous response is reset and an empty is written to the client. There are several solutions for your problem: 1) use a IResource instead of a Page. You don't use components anyway. See wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ for more info. 2) Use a WebPage that implements org.apache.wicket.markup.IMarkupResourceStreamProvider and org.apache.wicket.markup.IMarkupCacheKeyProvider The first interface is needed to generate the markup dynamically. E.g. : return new StringResourceStream(yourDataReturnedFromHttpClient) The second should return null in #getCacheKey() to not cache the result from the first. I.e. Wicket will ask IMarkupCacheKeyProvider for new data for each request. 3) Do what Igor suggested with EmptyRequestHandler but use TextRequestHandler(yourDataReturnedFromHttpClient) instead. On Tue, Dec 20, 2011 at 10:11 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: what is the stack trace look like now? also, no need to extend a webpage, why not just impplement IRequestHandler directly and mount it somewhere so you can construct urls to it... -igor On Tue, Dec 20, 2011 at 11:24 AM, Pablo Díazinspd...@gmail.com wrote: I've done that, but I get the same result :( El 20/12/11 20:18, Igor Vaynberg escribió: (httpservletresponse)getresponse().getcontainerresponse() -igor On Tue, Dec 20, 2011 at 10:58 AM, Pablo Díazinspd...@gmail.comwrote: Ok, but How I can get the httpservletresponse object to write in it? I'm extending the WebPage class ... El 20/12/11 19:26, Igor Vaynberg escribió: try writing directly into httpservletresponse instead of wicket's response. there is a bug fix for this in the upcoming release -igor On Tue, Dec 20, 2011 at 10:03 AM, Pablo Díazinspd...@gmail.com wrote: Ok, thank you, I'm not getting the error if I use your code, but I'm not able to gets the response (I always get a blank image, when I must get a map). I mean, I only like getting the request done from someone and check if he has enough privileges to do some operation Then, I change some parameters depends on his role he can. My code is like this: public class ProxyAction extends WebPage { public ProxyAction(PageParameters parameters){ URL url = null; Logger logger = Logger.getLogger(ProxyAction.class); HttpURLConnection con = null; Response response = getResponse(); ByteArrayBuffer bab = new ByteArrayBuffer(); try { String mapserverUrl = http://localhost/cgi-bin/mapserv?mode=mapmap=/var/local/mapserver/inveco/map/client_draw.maplayers=provincias;; IteratorString it = claves.iterator(); while(it.hasNext()){ String clave = (String) it.next(); mapserverUrl= mapserverUrl + + clave+=; ListStringValue valores = parameters.getValues(clave); for(int i=0; ivalores.size(); i++){ mapserverUrl = mapserverUrl+valores.get(i)+ ; } } url = new URL(mapserverUrl); con = (HttpURLConnection) url.openConnection(); InputStream istream = con.getInputStream(); byte[] b = new byte[1]; for(;;){ if(istream.read(b) == -1) break; bab.write(b); } response.write(bab.getRawData()); getRequestCycle().replaceAllRequestHandlers(new EmptyRequestHandler()); } catch (MalformedURLException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } //this.getRequestCycle().setResponse(response); } } El 20/12/11 18:17, Igor Vaynberg escribió: in the future, start with the error :) you have to tell wicket that it should not render the page after you have written the data out... output.write(data); getrequestcycle().replaceallrequesthandlers(new EmptyRequestHandler()); -igor On Tue, Dec 20, 2011 at 8:54 AM, Pablo Díazinspd...@gmail.com wrote: Because when I try to write to response I get's this error: ERROR - DefaultExceptionMapper - Unexpected error occurred java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called. at org.apache.wicket.protocol.http.BufferedWebResponse.write(BufferedWebResponse.java:465) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1525) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638) at org.apache.wicket.Page.onRender(Page.java:904) at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140) at
Re: Getting response from a external URL
On Wed, Dec 21, 2011 at 7:50 PM, Pablo Díaz inspd...@gmail.com wrote: Thank you for your answer but I think this is only correct when you are returning a CharSequence, what's happen when you like returning Image, for example? If you need to return an Image then definitely you don't need to extend a Page. See solution 1) I suggested - using IResource. El 21/12/11 10:33, Martin Grigorov escribió: The problem with EmptyRequestHandler is that the previous response is reset and an empty is written to the client. There are several solutions for your problem: 1) use a IResource instead of a Page. You don't use components anyway. See wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ for more info. 2) Use a WebPage that implements org.apache.wicket.markup.IMarkupResourceStreamProvider and org.apache.wicket.markup.IMarkupCacheKeyProvider The first interface is needed to generate the markup dynamically. E.g. : return new StringResourceStream(yourDataReturnedFromHttpClient) The second should return null in #getCacheKey() to not cache the result from the first. I.e. Wicket will ask IMarkupCacheKeyProvider for new data for each request. 3) Do what Igor suggested with EmptyRequestHandler but use TextRequestHandler(yourDataReturnedFromHttpClient) instead. On Tue, Dec 20, 2011 at 10:11 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: what is the stack trace look like now? also, no need to extend a webpage, why not just impplement IRequestHandler directly and mount it somewhere so you can construct urls to it... -igor On Tue, Dec 20, 2011 at 11:24 AM, Pablo Díazinspd...@gmail.com wrote: I've done that, but I get the same result :( El 20/12/11 20:18, Igor Vaynberg escribió: (httpservletresponse)getresponse().getcontainerresponse() -igor On Tue, Dec 20, 2011 at 10:58 AM, Pablo Díazinspd...@gmail.com wrote: Ok, but How I can get the httpservletresponse object to write in it? I'm extending the WebPage class ... El 20/12/11 19:26, Igor Vaynberg escribió: try writing directly into httpservletresponse instead of wicket's response. there is a bug fix for this in the upcoming release -igor On Tue, Dec 20, 2011 at 10:03 AM, Pablo Díazinspd...@gmail.com wrote: Ok, thank you, I'm not getting the error if I use your code, but I'm not able to gets the response (I always get a blank image, when I must get a map). I mean, I only like getting the request done from someone and check if he has enough privileges to do some operation Then, I change some parameters depends on his role he can. My code is like this: public class ProxyAction extends WebPage { public ProxyAction(PageParameters parameters){ URL url = null; Logger logger = Logger.getLogger(ProxyAction.class); HttpURLConnection con = null; Response response = getResponse(); ByteArrayBuffer bab = new ByteArrayBuffer(); try { String mapserverUrl = http://localhost/cgi-bin/mapserv?mode=mapmap=/var/local/mapserver/inveco/map/client_draw.maplayers=provincias;; IteratorString it = claves.iterator(); while(it.hasNext()){ String clave = (String) it.next(); mapserverUrl= mapserverUrl + + clave+=; ListStringValue valores = parameters.getValues(clave); for(int i=0; ivalores.size(); i++){ mapserverUrl = mapserverUrl+valores.get(i)+ ; } } url = new URL(mapserverUrl); con = (HttpURLConnection) url.openConnection(); InputStream istream = con.getInputStream(); byte[] b = new byte[1]; for(;;){ if(istream.read(b) == -1) break; bab.write(b); } response.write(bab.getRawData()); getRequestCycle().replaceAllRequestHandlers(new EmptyRequestHandler()); } catch (MalformedURLException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } //this.getRequestCycle().setResponse(response); } } El 20/12/11 18:17, Igor Vaynberg escribió: in the future, start with the error :) you have to tell wicket that it should not render the page after you have written the data out... output.write(data); getrequestcycle().replaceallrequesthandlers(new EmptyRequestHandler()); -igor On Tue, Dec 20, 2011 at 8:54 AM, Pablo Díazinspd...@gmail.com wrote: Because when I try to write to response I get's this error: ERROR - DefaultExceptionMapper - Unexpected error occurred java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called. at org.apache.wicket.protocol.http.BufferedWebResponse.write(BufferedWebResponse.java:465) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1525)
Re: Getting response from a external URL
Thank you so much it's works, very well ... The correct form was the next: (WebApplication) protected void init() { super.init(); mountPage(Init.do,HomePage.class); mountPage(Viewer.do,ViewerPage.class); *mountResource(ProxyMapserver.do,new ProxyAction());* Locale.setDefault(new Locale(GL)); } (ProxyAction) public class ProxyAction extends*ResourceReference*{ public ProxyAction(){ super(ProxyAction.class,mapProvider); } public void respond(Attributes arg0) { } *@Override public IResource getResource() { return new ImageProvider(); }* } (ImageProvider) public class ImageProvider extends DynamicImageResource{ @Override *protected byte[] getImageData(Attributes attributes)* { URL url = null; HttpURLConnection con = null; Logger logger = Logger.getLogger(ImageProvider.class); ByteArrayBuffer bab = new ByteArrayBuffer(); try { String mapserverUrl = http://localhost/cgi-bin/mapserv?mode=mapmap=/var/local/mapserver/inveco/map/client_draw.maplayers=provincias;; PageParameters pageParameters = attributes.getParameters(); SetString claves = pageParameters.getNamedKeys(); IteratorString it = claves.iterator(); while(it.hasNext()){ String clave = (String) it.next(); mapserverUrl= mapserverUrl + + clave+=; ListStringValue valores = pageParameters.getValues(clave); for(int i=0; ivalores.size(); i++){ mapserverUrl = mapserverUrl+valores.get(i)+ ; } } url = new URL(mapserverUrl); con = (HttpURLConnection) url.openConnection(); InputStream istream = con.getInputStream(); byte[] b = new byte[1]; for(;;){ if(istream.read(b) == -1) break; bab.write(b); } } catch (MalformedURLException e) { logger.error(e.getMessage()); } catch (IOException e) { logger.error(e.getMessage()); } return bab.getRawData(); } @Override public boolean equals(Object that) { return that instanceof ImageProvider; } } Thanks, Igor and Martin, for your help!!! El 21/12/11 18:59, Martin Grigorov escribió: On Wed, Dec 21, 2011 at 7:50 PM, Pablo Díazinspd...@gmail.com wrote: Thank you for your answer but I think this is only correct when you are returning a CharSequence, what's happen when you like returning Image, for example? If you need to return an Image then definitely you don't need to extend a Page. See solution 1) I suggested - using IResource. El 21/12/11 10:33, Martin Grigorov escribió: The problem with EmptyRequestHandler is that the previous response is reset and an empty is written to the client. There are several solutions for your problem: 1) use a IResource instead of a Page. You don't use components anyway. See wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ for more info. 2) Use a WebPage that implements org.apache.wicket.markup.IMarkupResourceStreamProvider and org.apache.wicket.markup.IMarkupCacheKeyProvider The first interface is needed to generate the markup dynamically. E.g. : return new StringResourceStream(yourDataReturnedFromHttpClient) The second should return null in #getCacheKey() to not cache the result from the first. I.e. Wicket will ask IMarkupCacheKeyProvider for new data for each request. 3) Do what Igor suggested with EmptyRequestHandler but use TextRequestHandler(yourDataReturnedFromHttpClient) instead. On Tue, Dec 20, 2011 at 10:11 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: what is the stack trace look like now? also, no need to extend a webpage, why not just impplement IRequestHandler directly and mount it somewhere so you can construct urls to it... -igor On Tue, Dec 20, 2011 at 11:24 AM, Pablo Díazinspd...@gmail.comwrote: I've done that, but I get the same result :( El 20/12/11 20:18, Igor Vaynberg escribió: (httpservletresponse)getresponse().getcontainerresponse() -igor On Tue, Dec 20, 2011 at 10:58 AM, Pablo Díazinspd...@gmail.com wrote: Ok, but How I can get the httpservletresponse object to write in it? I'm extending the WebPage class ... El 20/12/11 19:26, Igor Vaynberg escribió: try writing directly into httpservletresponse instead of wicket's response. there is a bug fix for this in the upcoming release -igor On Tue, Dec 20, 2011 at 10:03 AM, Pablo Díazinspd...@gmail.com wrote: Ok, thank you, I'm not getting the error if I use your code, but I'm not able to gets the response (I always get a blank image, when I must get a map). I mean, I only like getting the request done from someone and check if he has enough privileges to do some operation Then, I change some parameters depends on his role he can. My code is like this: public class
Re: Problem with wicketstuff-tinymce-1.5.3 external plugins
We find the problem,the are no problem with wicketstuff-tinymce-1.5.3 the problem was at our application. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-with-wicketstuff-tinymce-1-5-3-external-plugins-tp4222060p4222840.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: ModalWindow does not close cleanly
I have created a ticket, and attached a quick start to it https://issues.apache.org/jira/browse/WICKET-4311 Notice that if you uncomment the dummy callback code, you will be able to reopen the modal. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicket 1.3.7 RestartResponseAtInterceptPageException post data lost
Hi all, I am using wicket 1.3.7 for our product. Currently, I have encountered a problem, a form submitting is corrupted by session timeout, description as follows, - there is a report page, and a form in it, a user fill some parameter in that form, method post - after the user's session timeout, he or she tries to submit the form - the server starts to process the request, due to unauthorized problem, (we add an IUnauthroizedComponentInstantiationListener implementation), A RestartResponseAtInterceptPageException is throwed. - the user is redirect to the login page - after the user has logon, the browser is redirected to the report page, but all the parameter in the form is empty I tried the debug tool for tracing the operation. - in the RestartResponseAtInterceptPageException constructor, the original request, the submit of form in report page has been translated to a URL and stored in a PageMap object's interceptContinuationURL var, for later using after user logon. but here the setting on interceptContinuationURL, only contains the pathinfo and queryString of httpreqeust, the post data has been abandoned. - the redirection after the user logon has actually triggered the submit form, since the url contains the 'IformSubmitListener' but as post data has been abandoned, the submitting has no valid parameter. What I am expecting is to have the form submitting result consistent no matter the user's session has been timeout or not. Or is it a nature feature for Wicket treating redirection logic, to abandon the post data? Can anyone help me for this issue? Thanks Regards, Liwei
Re: wicket 1.3.7 RestartResponseAtInterceptPageException post data lost
only wicket=1.5.0 propagates post data in intercepts. -igor On Wed, Dec 21, 2011 at 5:56 PM, 鄂力炜 daura...@gmail.com wrote: Hi all, I am using wicket 1.3.7 for our product. Currently, I have encountered a problem, a form submitting is corrupted by session timeout, description as follows, - there is a report page, and a form in it, a user fill some parameter in that form, method post - after the user's session timeout, he or she tries to submit the form - the server starts to process the request, due to unauthorized problem, (we add an IUnauthroizedComponentInstantiationListener implementation), A RestartResponseAtInterceptPageException is throwed. - the user is redirect to the login page - after the user has logon, the browser is redirected to the report page, but all the parameter in the form is empty I tried the debug tool for tracing the operation. - in the RestartResponseAtInterceptPageException constructor, the original request, the submit of form in report page has been translated to a URL and stored in a PageMap object's interceptContinuationURL var, for later using after user logon. but here the setting on interceptContinuationURL, only contains the pathinfo and queryString of httpreqeust, the post data has been abandoned. - the redirection after the user logon has actually triggered the submit form, since the url contains the 'IformSubmitListener' but as post data has been abandoned, the submitting has no valid parameter. What I am expecting is to have the form submitting result consistent no matter the user's session has been timeout or not. Or is it a nature feature for Wicket treating redirection logic, to abandon the post data? Can anyone help me for this issue? Thanks Regards, Liwei - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: wicket 1.3.7 RestartResponseAtInterceptPageException post data lost
THX : ) 2011/12/21 Igor Vaynberg igor.vaynb...@gmail.com only wicket=1.5.0 propagates post data in intercepts. -igor On Wed, Dec 21, 2011 at 5:56 PM, 鄂力炜 daura...@gmail.com wrote: Hi all, I am using wicket 1.3.7 for our product. Currently, I have encountered a problem, a form submitting is corrupted by session timeout, description as follows, - there is a report page, and a form in it, a user fill some parameter in that form, method post - after the user's session timeout, he or she tries to submit the form - the server starts to process the request, due to unauthorized problem, (we add an IUnauthroizedComponentInstantiationListener implementation), A RestartResponseAtInterceptPageException is throwed. - the user is redirect to the login page - after the user has logon, the browser is redirected to the report page, but all the parameter in the form is empty I tried the debug tool for tracing the operation. - in the RestartResponseAtInterceptPageException constructor, the original request, the submit of form in report page has been translated to a URL and stored in a PageMap object's interceptContinuationURL var, for later using after user logon. but here the setting on interceptContinuationURL, only contains the pathinfo and queryString of httpreqeust, the post data has been abandoned. - the redirection after the user logon has actually triggered the submit form, since the url contains the 'IformSubmitListener' but as post data has been abandoned, the submitting has no valid parameter. What I am expecting is to have the form submitting result consistent no matter the user's session has been timeout or not. Or is it a nature feature for Wicket treating redirection logic, to abandon the post data? Can anyone help me for this issue? Thanks Regards, Liwei - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org