Re: component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hi Martin, hi list I guess I narrowed things down a bit. I was obviously looking at the wrong places. The problem is with the renderedComponents Set (and not with the isAuto flag as thought at first). In the Page class there is that check here: // If component never rendered if (renderedComponents == null || !renderedComponents.contains(component)) and this method: public final void componentRendered(final Component component) { // Inform the page that this component rendered if (getApplication().getDebugSettings().getComponentUseCheck()) { This method is obviously only run in the debug mode when the ComponentUseCheck is activated (which is by default). Which also means that said Set is only instantiated when ComponentUseCheck is activated. Which also means the check in the first copy above will not be run when ComponentUseCheck is false/deactivated. Now that I deactivated that check, my renderer works again. So there must be some problem with dynamic components. I looked through the render methods of 1.5x and 1.4x. While some things changed, the flow seems to be mostly the same. Nothing obvious. I'd love to do a minimal quickstart but that won't be very minimal. I'd have to add most of the renderer, or rewrite parts. I'll see if I find some time to put together something small. In the meantime. If somebody has an idea where to look at, I'd be happy to test things out on my codebase. Cheers, Adrian On 4/12/12 5:02 PM, Martin Grigorov wrote: Hi, On Thu, Apr 12, 2012 at 5:48 PM, Adrian Wiesmannawiesm...@somap.org wrote: Hi Me again with a follow up to my isAuto() problem. Setting component.setAuto(true) is quite bad, since Wicket will remove all components in the detachChildren() method which have the Auto Flag and which are not an instance of InlineEnclosure. Which all of my components obviously are not... While the isAuto(true) results in a nicely rendered component tree, when you try to click on - say a row in a list - then Wicket throws an error because the component in question was removed. Well here we are again. How can I port my renderer which adds components to the component tree on the fly as I was able to do in Wicket 1.5? What was the intention to change the behaviour there? It is not clear to me which behavior exactly has changed and now causes you troubles. Create a minimal quickstart that works on 1.4 and attach it to a ticket in Jira. Regards, Adrian On 2/12/12 7:27 PM, Adrian Wiesmann wrote: Hello list Some while ago I posted a few messages to this list where I asked for help in finding a problem with Wicket 1.5. I was not able to find the bug back then. Now I downloaded the bleeding edge version 1.5.4 and tried again. And now I am a step further. I have that rendering engine where I take an XML file, build an object tree from that and have a renderer rendering a Wicket object tree and finally Wicket which renders the HTML UI from that. Now I noticed with version 1.5 of Wicket, that this line in the org.apache.wicket.Page.class are the key to my problem (lines 611, 612): // If not an auto component ... if (!component.isAuto() component.isVisibleInHierarchy()) I noticed that many of my components I add in my renderer on the fly are returning isAuto = false on that line (and of course they are visible, which adds them to unrenderedComponents and ultimately provokes the error). I then added this.setAuto(true); in one of my components. And voila, it was not in the list of components which failed to render. So here are my questions: - What did change from version 1.4.x to version 1.5.x that results in this error? - Is that a bug in Wicket or do I need to fix my renderer somehow? - What side effects does it have if I just add a setAuto(true) to all of my components? Thanks for your help! Cheers, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hi Me again with a follow up to my isAuto() problem. Setting component.setAuto(true) is quite bad, since Wicket will remove all components in the detachChildren() method which have the Auto Flag and which are not an instance of InlineEnclosure. Which all of my components obviously are not... While the isAuto(true) results in a nicely rendered component tree, when you try to click on - say a row in a list - then Wicket throws an error because the component in question was removed. Well here we are again. How can I port my renderer which adds components to the component tree on the fly as I was able to do in Wicket 1.5? What was the intention to change the behaviour there? Regards, Adrian On 2/12/12 7:27 PM, Adrian Wiesmann wrote: Hello list Some while ago I posted a few messages to this list where I asked for help in finding a problem with Wicket 1.5. I was not able to find the bug back then. Now I downloaded the bleeding edge version 1.5.4 and tried again. And now I am a step further. I have that rendering engine where I take an XML file, build an object tree from that and have a renderer rendering a Wicket object tree and finally Wicket which renders the HTML UI from that. Now I noticed with version 1.5 of Wicket, that this line in the org.apache.wicket.Page.class are the key to my problem (lines 611, 612): // If not an auto component ... if (!component.isAuto() component.isVisibleInHierarchy()) I noticed that many of my components I add in my renderer on the fly are returning isAuto = false on that line (and of course they are visible, which adds them to unrenderedComponents and ultimately provokes the error). I then added this.setAuto(true); in one of my components. And voila, it was not in the list of components which failed to render. So here are my questions: - What did change from version 1.4.x to version 1.5.x that results in this error? - Is that a bug in Wicket or do I need to fix my renderer somehow? - What side effects does it have if I just add a setAuto(true) to all of my components? Thanks for your help! Cheers, 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
Re: component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hi, On Thu, Apr 12, 2012 at 5:48 PM, Adrian Wiesmann awiesm...@somap.org wrote: Hi Me again with a follow up to my isAuto() problem. Setting component.setAuto(true) is quite bad, since Wicket will remove all components in the detachChildren() method which have the Auto Flag and which are not an instance of InlineEnclosure. Which all of my components obviously are not... While the isAuto(true) results in a nicely rendered component tree, when you try to click on - say a row in a list - then Wicket throws an error because the component in question was removed. Well here we are again. How can I port my renderer which adds components to the component tree on the fly as I was able to do in Wicket 1.5? What was the intention to change the behaviour there? It is not clear to me which behavior exactly has changed and now causes you troubles. Create a minimal quickstart that works on 1.4 and attach it to a ticket in Jira. Regards, Adrian On 2/12/12 7:27 PM, Adrian Wiesmann wrote: Hello list Some while ago I posted a few messages to this list where I asked for help in finding a problem with Wicket 1.5. I was not able to find the bug back then. Now I downloaded the bleeding edge version 1.5.4 and tried again. And now I am a step further. I have that rendering engine where I take an XML file, build an object tree from that and have a renderer rendering a Wicket object tree and finally Wicket which renders the HTML UI from that. Now I noticed with version 1.5 of Wicket, that this line in the org.apache.wicket.Page.class are the key to my problem (lines 611, 612): // If not an auto component ... if (!component.isAuto() component.isVisibleInHierarchy()) I noticed that many of my components I add in my renderer on the fly are returning isAuto = false on that line (and of course they are visible, which adds them to unrenderedComponents and ultimately provokes the error). I then added this.setAuto(true); in one of my components. And voila, it was not in the list of components which failed to render. So here are my questions: - What did change from version 1.4.x to version 1.5.x that results in this error? - Is that a bug in Wicket or do I need to fix my renderer somehow? - What side effects does it have if I just add a setAuto(true) to all of my components? Thanks for your help! Cheers, 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 -- 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
component.isAuto - was: Wicket 1.5: The component(s) below failed to render (revisited)
Hello list Some while ago I posted a few messages to this list where I asked for help in finding a problem with Wicket 1.5. I was not able to find the bug back then. Now I downloaded the bleeding edge version 1.5.4 and tried again. And now I am a step further. I have that rendering engine where I take an XML file, build an object tree from that and have a renderer rendering a Wicket object tree and finally Wicket which renders the HTML UI from that. Now I noticed with version 1.5 of Wicket, that this line in the org.apache.wicket.Page.class are the key to my problem (lines 611, 612): // If not an auto component ... if (!component.isAuto() component.isVisibleInHierarchy()) I noticed that many of my components I add in my renderer on the fly are returning isAuto = false on that line (and of course they are visible, which adds them to unrenderedComponents and ultimately provokes the error). I then added this.setAuto(true); in one of my components. And voila, it was not in the list of components which failed to render. So here are my questions: - What did change from version 1.4.x to version 1.5.x that results in this error? - Is that a bug in Wicket or do I need to fix my renderer somehow? - What side effects does it have if I just add a setAuto(true) to all of my components? Thanks for your help! Cheers, Adrian - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
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
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