Re: weird "Unable to find component with id"
Hi Thorsten, Thanks for your comments. Weird thing is it only happens rarely in production. I have tried to reproduce this locally simulating random user access with no success. On Wed, May 4, 2016 at 7:11 PM, Thorsten Schöning wrote: > Guten Tag Ernesto Reinaldo Barreiro, > am Mittwoch, 4. Mai 2016 um 12:27 schrieben Sie: > > > I have tried to reproduce this locally in "development" and "production" > > modes with no success. Are there any known issues that can cause this? > Any > > leads would be appreciated. > > I often have problems with an error message like yours, not with the > strange ids though, during development, if I e.g. change markup and > just reload a formerly working page in the browser instead of > requesting a new and/or restarting Tomcat. > > So if your customer is not changing markup, he maybe has customers > accessing old versions of pages referencing things in markup which > don't exist anymore because of upgrades and such. > > Mit freundlichen Grüßen, > > Thorsten Schöning > > -- > Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de > AM-SoFT IT-Systeme http://www.AM-SoFT.de/ > > Telefon...05151- 9468- 55 > Fax...05151- 9468- 88 > Mobil..0178-8 9468- 04 > > AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln > AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Regards - Ernesto Reinaldo Barreiro
Re: weird "Unable to find component with id"
Hi Martin, Thanks for your answer. On Thu, May 5, 2016 at 8:36 AM, Martin Grigorov wrote: > Hi Ernesto, > > Does this page use variations/style, e.g. > ReplyToProjectRequestPage_custom.html > ? > No there is only ReplyToProjectRequestPage.html: that was one of the first things I checked. It's weird because: 1- There is no business related exception and I looked at wicket code and nothing seems to be catching/swallowing any exceptions. It looks as if for some weird reason wicket is at that moment not able find "main" on the markup associated to page. 2- This page is called around 500/600 times per day and in two week this happened 16 times. So it must be some extreme edge case... (e.g. first time after a redeployment?) Additional info: 1- On March 14th we jumped from 6.20.0 to 6.22.0. This feature was "there" but was not activated. 2- On May 4th those errors started to happen (and around the same time feature was activated). So we don't know for sure if this is 6.22.0 related or not. I was looking at changes from 6.20.0 to 6.22.0 and at first sight I could no spot anything suspicious. Anyway, we have migrated project to 7.3 and we probably will start using it next week. I will report back any issues I find :-) Thanks again! -- Regards - Ernesto Reinaldo Barreiro
Re: weird "Unable to find component with id"
Hi Ernesto, Does this page use variations/style, e.g. ReplyToProjectRequestPage_custom.html ? It could be that some user uses this custom variation and you test with the default version. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, May 4, 2016 at 12:27 PM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Hi, > > Or a customers production server this happens sometimes.. > > === > 2016-05-03 19:36:15,936 ERROR > org.apache.wicket.DefaultExceptionMapper: 170 [req: > I7Ax7LCI5L9 p: XwklMo8cZ3X][acc: anonymous] - Unexpected error occurred > Unable to find component with id 'main' in > [TransparentWebMarkupContainer [Component > id = wicket_extend8]] > Expected: 'wicket_child7:wicket_extend8:main'. > Found with similar names: 'header:loginForm:loginForm:email' > MarkupStream: [markup = > > file:/var/lib/tomcat8/webapps/.../WEB-INF/classes/./ReplyToProjectRequestPage.html > > > > > > > > > > > > , index = 2, current = '' (line 0, > column 0)] > at > > org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526) > at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1438) > at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1557) > at > > org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1532) > at > > org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1487) > at > > org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71) > at org.apache.wicket.Component.internalRenderComponent(Component.java:2536) > at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1496) > at org.apache.wicket.Component.internalRender(Component.java:2366) > at org.apache.wicket.Component.render(Component.java:2294) > at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1392) > at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1557) > = > > I have tried to reproduce this locally in "development" and "production" > modes with no success. Are there any known issues that can cause this? Any > leads would be appreciated. > > > -- > Regards - Ernesto Reinaldo Barreiro >
Re: weird "Unable to find component with id"
Guten Tag Ernesto Reinaldo Barreiro, am Mittwoch, 4. Mai 2016 um 12:27 schrieben Sie: > I have tried to reproduce this locally in "development" and "production" > modes with no success. Are there any known issues that can cause this? Any > leads would be appreciated. I often have problems with an error message like yours, not with the strange ids though, during development, if I e.g. change markup and just reload a formerly working page in the browser instead of requesting a new and/or restarting Tomcat. So if your customer is not changing markup, he maybe has customers accessing old versions of pages referencing things in markup which don't exist anymore because of upgrades and such. Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning E-Mail: thorsten.schoen...@am-soft.de AM-SoFT IT-Systeme http://www.AM-SoFT.de/ Telefon...05151- 9468- 55 Fax...05151- 9468- 88 Mobil..0178-8 9468- 04 AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
weird "Unable to find component with id"
Hi, Or a customers production server this happens sometimes.. === 2016-05-03 19:36:15,936 ERROR org.apache.wicket.DefaultExceptionMapper: 170 [req: I7Ax7LCI5L9 p: XwklMo8cZ3X][acc: anonymous] - Unexpected error occurred Unable to find component with id 'main' in [TransparentWebMarkupContainer [Component id = wicket_extend8]] Expected: 'wicket_child7:wicket_extend8:main'. Found with similar names: 'header:loginForm:loginForm:email' MarkupStream: [markup = file:/var/lib/tomcat8/webapps/.../WEB-INF/classes/./ReplyToProjectRequestPage.html , index = 2, current = '' (line 0, column 0)] at org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1438) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1557) at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1532) at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1487) at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:71) at org.apache.wicket.Component.internalRenderComponent(Component.java:2536) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1496) at org.apache.wicket.Component.internalRender(Component.java:2366) at org.apache.wicket.Component.render(Component.java:2294) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1392) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1557) = I have tried to reproduce this locally in "development" and "production" modes with no success. Are there any known issues that can cause this? Any leads would be appreciated. -- Regards - Ernesto Reinaldo Barreiro
RE: Misunderstanding : Unable to find component with id 'phl' or A child with id 'phl' already exists:
Sorry, I still don't get it. What are you trying to set? There is no link in your example, only labels. If you want to change the text in the label, you can use models instead of static strings. If you want to add a link in your header you can have a look at OrderByBorder... regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Misunderstanding-Unable-to-find-component-with-id-phl-or-A-child-with-id-phl-already-exists-tp4674083p4674090.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: Misunderstanding : Unable to find component with id 'phl' or A child with id 'phl' already exists:
The ajout method is a debug method. The main objective is that the method HeadersToolbar//HeadersToolbar(final DataTable/RefreshingView>//Iterator>>//populateItem(Item> item) is able to modify the content of "getheader" that is the X1 object (X1 is a for debug). In case 1 - I use "ajout" and wicket says phl already exists in the X1 object. OK, I agree. X1 has already 2 labels. In case 2 - I use "ajout", but the phl label is not yet declared in the java object (ajout must add it), but the wicket render says "Sorry, phl label does not exists". This means that I cannot modify the getheader object from HeadersToolbar. The example set the sortable link to the global header object. But I want to put the sortable link to part of the header object. Thanks, PHL De : Gabriel Landon Envoyé : mardi 22 mars 2016 18:04 À : users@wicket.apache.org Objet : Re: Misunderstanding : Unable to find component with id 'phl' or A child with id 'phl' already exists: PHL, I'm sorry but it's hard to understand what your are trying to do. Anyway, I find the X1 class very strange. I think you simply need to remove the "ajout" method as the label is already added in the constructor. You cannot add a label several times on the same panel unless you are using a repeater. public class X1 extends Panel { public X1(String id, String ColumnTilte) { super(id) ; lbl = new Label("labelx", ColumnTilte) ; add(lbl) ; add(new Label("phl","added by constructor")) ; } public Label getLabel() { return lbl ; } } regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Misunderstanding-Unable-to-find-component-with-id-phl-or-A-child-with-id-phl-already-exists-tp4674083p4674087.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: Misunderstanding : Unable to find component with id 'phl' or A child with id 'phl' already exists:
PHL, I'm sorry but it's hard to understand what your are trying to do. Anyway, I find the X1 class very strange. I think you simply need to remove the "ajout" method as the label is already added in the constructor. You cannot add a label several times on the same panel unless you are using a repeater. public class X1 extends Panel { public X1(String id, String ColumnTilte) { super(id) ; lbl = new Label("labelx", ColumnTilte) ; add(lbl) ; add(new Label("phl","added by constructor")) ; } public Label getLabel() { return lbl ; } } regards, Gabriel. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Misunderstanding-Unable-to-find-component-with-id-phl-or-A-child-with-id-phl-already-exists-tp4674083p4674087.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
Misunderstanding : Unable to find component with id 'phl' or A child with id 'phl' already exists:
Hello, I try to modify the header of a table. So according to the advice of this mailing list, I write public class DataTableFilterToolbarPage extends WebPage { /** * constructor */ public DataTableFilterToolbarPage() { List> columns = new ArrayList>(); columns.add(new PropertyColumn(new Model("ID"), "id") { private static final long serialVersionUID = 1L; @Override public Component getHeader(final String componentId) { X1 x = new X1(componentId,"id") ; // My own panel instead of a label return x; } }); As I want to set the sortable link in a part of X1, I modify HeadersToolbar public HeadersToolbar(final DataTable table, final ISortStateLocator stateLocator) { super(table); RefreshingView> headers = new RefreshingView>("headers") { private static final long serialVersionUID = 1L; @Override protected Iterator>> getItemModels() @Override protected void populateItem(Item> item) { if (column.isSortable()) { header = newSortableHeader("header", column.getSortProperty(), stateLocator); } else { header = new WebMarkupContainer("header"); } if (column instanceof IStyledColumn) { } item.add(header); item.setRenderBodyOnly(true) ((X1)column.getHeader("panel")).ajout() ; // action on X1 header.add(column.getHeader("panel")); Where X1 is public class X1 extends Panel { public X1(String id, String ColumnTilte) //, TextField x) { super(id) ; lbl = new Label("labelx", ColumnTilte) ; add(lbl) ; } public Label getLabel() { return lbl ; } public void ajout() { add(new Label("phl","added by headersTools")) ; } } Run this code, I get Unexpected RuntimeException Last cause: Unable to find component with id 'phl' in [X1 [Component id = panel]] Expected: 'filterForm:tableWithFilterForm:topToolbars:toolbars:3:headers:1:header:panel:phl'. Found with similar names: '' Markup The problem is in "file:/home/phl/apache-tomcat-7.0.47/webapps/phlwick/WEB-INF/classes/xxx/X1.html": http://wicket.apache.org";> 1 The Title of the column goes here Action from HeadersTools goes here I was expecting that the action ((X1)column.getHeader("panel")).ajout() ; will define phl in X1 If I change the X.java to public class X1 extends Panel { public X1(String id, String ColumnTilte) //, TextField x) { super(id) ; lbl = new Label("labelx", ColumnTilte) ; add(lbl) ; add(new Label("phl","added by constructor")) ; } public Label getLabel() { return lbl ; } public void ajout() { add(new Label("phl","added by headersTools")) ; } } So I don't understand why the some time the id phl is not declared and sometime is it already declared. This is probably due to the fact that I don't clearly understand the render mechanism. Pointers or ideas are welcome. Thanks, PHL. Then I get : Last cause: A child with id 'phl' already exists: [X1 [Component id = panel]] WicketMessage: Error attaching this container for rendering: [HeadersToolbar [Component id = 3]]
Re: Avoiding 'WicketMessage: Unable to find component with id' error
You should add the listView right away and keep it invisible until a search result is available. Sven On Mi, 2009-05-06 at 10:07 -0500, Vasu Srinivasan wrote: > Im a wicket newbie .. > > I have a Search Page with some search criteria inputs and below it, the list > of data based on search. > > The first time the page is hit, the listView component is not still present, > because Im adding that only onSubmit() -- like this: > > class XPage extends WebPage { > > class XForm extends Form { >... > >@Override public void onSubmit() { > List resultList = searchDao.search(searchOptions); > add(new ListView ("listView", resultList ) { > }); >} > } > > The html is straightforward.. > > > > > > > > > ... > > > > > Even at first hit of the page, wicket shows up the message "Unable to find > component with id listView" .. > > Is there a way to make Wicket not worry about unfound components or is there > any other standard way of handling it ? > > Appreciate any help... > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Avoiding 'WicketMessage: Unable to find component with id' error
Im a wicket newbie .. I have a Search Page with some search criteria inputs and below it, the list of data based on search. The first time the page is hit, the listView component is not still present, because Im adding that only onSubmit() -- like this: class XPage extends WebPage { class XForm extends Form { ... @Override public void onSubmit() { List resultList = searchDao.search(searchOptions); add(new ListView ("listView", resultList ) { }); } } The html is straightforward.. ... Even at first hit of the page, wicket shows up the message "Unable to find component with id listView" .. Is there a way to make Wicket not worry about unfound components or is there any other standard way of handling it ? Appreciate any help... -- Regards, Vasu
Re: "Unable to find component with id"
Hi, All I found out the solution: Wicket is very strict with the hierarchy. If I define the markup this way: then I have to create components that way: BookmarkablePageLink link=new BookmarkablePageLink("link", clas, new PageParameters("id=" + element.getId())); link.add(new Label("label", element.getLabel())); item.add(link); so the component hierarchy must match. Thanks to everybody. -- View this message in context: http://www.nabble.com/%22Unable-to-find-component-with-id%22-tp19091781p19104593.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: "Unable to find component with id"
1. you are repeating the UL tag instead of the LI tag. You should use , but I'd recommend to rename the component to menuitem to make it more clear 2. you don't have child components defined in the markup for each element. This is necessary. and in your populateItem: link = new BookmarkablePageLink("link", ...); item.add(link); link.add(new Label("label", )); Martijn On Fri, Aug 22, 2008 at 11:01 AM, btakacs <[EMAIL PROTECTED]> wrote: > > I have just tried to change the markup to: > > > > > > > but it has the same result. > > And then I tried to remove that element from the markup: > > > > something > > > > > ... and the framework missed it: > > > 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). > > 1. [Component id = label, page = com.myapp.wicket.HomePage, path = > 0:mainNavigation:menu:0:label.Label, isVisible = true, isVersioned = true] > 2. [Component id = label, page = com.myapp.wicket.HomePage, path = > 0:mainNavigation:menu:1:label.Label, isVisible = true, isVersioned = true] > 3. [Component id = label, page = com.myapp.wicket.HomePage, path = > 0:mainNavigation:menu:2:label.Label, isVisible = true, isVersioned = true] > > at org.apache.wicket.Page.checkRendering(Page.java:1116) > at org.apache.wicket.Page.renderPage(Page.java:914) > > > any tips? > -- > View this message in context: > http://www.nabble.com/%22Unable-to-find-component-with-id%22-tp19091781p19103768.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.4 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: "Unable to find component with id"
I have just tried to change the markup to: but it has the same result. And then I tried to remove that element from the markup: something ... and the framework missed it: 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). 1. [Component id = label, page = com.myapp.wicket.HomePage, path = 0:mainNavigation:menu:0:label.Label, isVisible = true, isVersioned = true] 2. [Component id = label, page = com.myapp.wicket.HomePage, path = 0:mainNavigation:menu:1:label.Label, isVisible = true, isVersioned = true] 3. [Component id = label, page = com.myapp.wicket.HomePage, path = 0:mainNavigation:menu:2:label.Label, isVisible = true, isVersioned = true] at org.apache.wicket.Page.checkRendering(Page.java:1116) at org.apache.wicket.Page.renderPage(Page.java:914) any tips? -- View this message in context: http://www.nabble.com/%22Unable-to-find-component-with-id%22-tp19091781p19103768.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: "Unable to find component with id"
Hi It seems that there is some kind of fromatting in place which is confused because of my code fragments. I've just read the help. So, the mapping between components: -- MenuView view = new MenuView("menu", menu); add(view); // in HeaderPanel.java -- item.add(new BookmarkablePageLink("link", clas, new PageParameters("id=" + element.getId(; // in MenuView.java -- item.add(new Label("label", element.getLabel())); // in MenuView.java HeaderPanel.html Wicket Example Start of Example Title Goes Here HomePage.html: Hello -- View this message in context: http://www.nabble.com/%22Unable-to-find-component-with-id%22-tp19091781p19102855.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: "Unable to find component with id"
Hi John Patterson wrote: > > Basically, every wicket:id in your html files must have a component in > your java file and visa versa > I think, there is a mutual mapping between html and java. -- MenuView view = new MenuView("menu", menu); add(view); // in HeaderPanel.java -- item.add(new BookmarkablePageLink("link", clas, new PageParameters("id=" + element.getId(; // in MenuView.java -- item.add(new Label("label", element.getLabel())); // in MenuView.java Sorry, I see that I pasted the result code not the wicket templates. Here are the real template files: HeaderPanel.html Wicket Example Start of Example Title Goes Here HomePage.html Hello John Patterson wrote: > > That can't be the markup that generated that error because there is no tag > in it with a wicket:id="label" which the error message is complaining > about. > > But you also do not add a tag for exampleTitle which you add here > add(new Label("exampleTitle", exampleTitle)); > > Basically, every wicket:id in your html files must have a component in > your java file and visa versa > > > btakacs wrote: >> >> Hi >> >> I'm new in wicket. I tried to display a list of components, but I get the >> following error: >> >> WicketMessage: Unable to find component with id 'label' in >> [MarkupContainer [Component id = link, page = com.myapp.wicket.HomePage, >> path = 0:mainNavigation:menu:0:link.BookmarkablePageLink, isVisible = >> true, isVersioned = true]]. This means that you declared wicket:id=label >> in your markup, but that you either did not add the component to your >> page at all, or that the hierarchy does not match. >> [markup = >> file:/D:/workspace/NetBeansProjects/WicketTest/build/web/WEB-INF/classes/com/myapp/wicket/HeaderPanel.html >> >> The html: >> >> >> >> Wicket Example >> >> Start of Example Title Goes Here >> >> >> >> >> >> >> >> >> >> >> >> >> The MarkupComponents are: >> #PathSizeTypeModel Object >> 1mainNavigation 3K com.myapp.wicket.HeaderPanel >> No get >> method defined for class: class com.myapp.wicket.HomePage expression: >> mainNavigation >> 2mainNavigation:exampleTitle 421 bytes >> org.apache.wicket.markup.html.basic.Labelwicket >> 3mainNavigation:menu 4.4K >> org.apache.wicket.markup.html.list.ListView >> [EMAIL PROTECTED], >> [EMAIL PROTECTED], >> [EMAIL PROTECTED] >> 4mainNavigation:menu:0 4.4K >> org.apache.wicket.markup.html.list.ListItem >> [EMAIL PROTECTED] >> 5mainNavigation:menu:0:label 418 bytes >> org.apache.wicket.markup.html.basic.LabelFirst Page >> 6mainNavigation:menu:0:link 1K >> org.apache.wicket.markup.html.link.BookmarkablePageLink No get method >> defined for class: class com.myapp.wicket.HomePage expression: link >> 7mainNavigation:menu:1 4.4K >> org.apache.wicket.markup.html.list.ListItem >> [EMAIL PROTECTED] >> 8mainNavigation:menu:1:label 419 bytes >> org.apache.wicket.markup.html.basic.LabelSecond Page >> 9mainNavigation:menu:1:link 1K >> org.apache.wicket.markup.html.link.BookmarkablePageLink No get method >> defined for class: class com.myapp.wicket.HomePage expression: link >> 10 mainNavigation:menu:2 4.4K >> org.apache.wicket.markup.html.list.ListItem >> [EMAIL PROTECTED] >> 11 mainNavigation:menu:2:label 418 bytes >> org.apache.wicket.markup.html.basic.LabelThird Page >> 12 mainNavigation:menu:2:link 1K >> org.apache.wicket.markup.html.link.BookmarkablePageLink No get method >> defined for class: class com.myapp.wicket.HomePage expression: link >> 13 param 409 bytes >> org.apache.wicket.markup.html.basic.Label >> 0 >> 14 stylesheet 1.4K >> org.apache.wicket.markup.html.resources.StyleSheetReference No get >> method defined for class: class com.myapp.wicket.HomePage expression: >> stylesheet >> >> I have the f
Re: "Unable to find component with id"
Send the code for HomePage.html and HomePage.html. It looks like you declaring the label in the markup incongruent to your page hierarchy; make sure it's in the wicket tag "menu". Cheers, JP. On Thu, Aug 21, 2008 at 5:00 PM, btakacs <[EMAIL PROTECTED]> wrote: > > Hi > > I'm new in wicket. I tried to display a list of components, but I get the > following error: > > WicketMessage: Unable to find component with id 'label' in [MarkupContainer > [Component id = link, page = com.myapp.wicket.HomePage, path = > 0:mainNavigation:menu:0:link.BookmarkablePageLink, isVisible = true, > isVersioned = true]]. This means that you declared wicket:id=label in your > markup, but that you either did not add the component to your page at all, > or that the hierarchy does not match. > [markup = > file:/D:/workspace/NetBeansProjects/WicketTest/build/web/WEB-INF/classes/com/myapp/wicket/HeaderPanel.html > > The html: > > > >Wicket Example > >Start of Example Title Goes Here > > > > > > > > > > > > > The MarkupComponents are: > # PathSizeTypeModel Object > 1 mainNavigation 3K com.myapp.wicket.HeaderPanel > No get > method defined for class: class com.myapp.wicket.HomePage expression: > mainNavigation > 2 mainNavigation:exampleTitle 421 bytes > org.apache.wicket.markup.html.basic.Label wicket > 3 mainNavigation:menu 4.4K > org.apache.wicket.markup.html.list.ListView > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED] > 4 mainNavigation:menu:0 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 5 mainNavigation:menu:0:label 418 bytes > org.apache.wicket.markup.html.basic.Label First Page > 6 mainNavigation:menu:0:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 7 mainNavigation:menu:1 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 8 mainNavigation:menu:1:label 419 bytes > org.apache.wicket.markup.html.basic.Label Second Page > 9 mainNavigation:menu:1:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 10 mainNavigation:menu:2 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 11 mainNavigation:menu:2:label 418 bytes > org.apache.wicket.markup.html.basic.Label Third Page > 12 mainNavigation:menu:2:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 13 param 409 bytes > org.apache.wicket.markup.html.basic.Label > 0 > 14 stylesheet 1.4K > org.apache.wicket.markup.html.resources.StyleSheetReference No get > method defined for class: class com.myapp.wicket.HomePage expression: > stylesheet > > I have the following classes: > > public class HeaderPanel{ >public HeaderPanel(String componentName, String exampleTitle) >{ >super(componentName); >add(new Label("exampleTitle", exampleTitle)); >ArrayList menu=new ArrayList(); >menu.add(new MenuModel("1", "HomePage", "First Page")); >menu.add(new MenuModel("2", "HomePage", "Second Page")); >menu.add(new MenuModel("3", "HomePage", "Third Page")); > >MenuView view = new MenuView("menu", menu); >add(view); > >} > } > > public class MenuView extends ListView { > >public MenuView(final String id) { >super(id); >} > >public MenuView(final String id, final IModel model) { >super(id, model); >} > >public MenuView(final String id, final List list) { >super(id, list); >} > >@Override >protected void populateItem(ListItem item) { >final MenuModel element = (MenuModel) item.getModelObject(); >Class clas; >try { >clas = Class.forName(element.getClas()); >} catch (ClassNotFoundException ex) { >Logger.getLogger(MenuView.class.getName()).log(Level.WARNING, > null, ex); >clas=this.getApplication().getHomePage(); >} > >item.add(new Label("label", element.getLabel())); >item.add(new BookmarkablePageL
Re: "Unable to find component with id"
That can't be the markup that generated that error because there is no tag in it with a wicket:id="label" which the error message is complaining about. But you also do not add a tag for exampleTitle which you add here add(new Label("exampleTitle", exampleTitle)); Basically, every wicket:id in your html files must have a component in your java file and visa versa btakacs wrote: > > Hi > > I'm new in wicket. I tried to display a list of components, but I get the > following error: > > WicketMessage: Unable to find component with id 'label' in > [MarkupContainer [Component id = link, page = com.myapp.wicket.HomePage, > path = 0:mainNavigation:menu:0:link.BookmarkablePageLink, isVisible = > true, isVersioned = true]]. This means that you declared wicket:id=label > in your markup, but that you either did not add the component to your page > at all, or that the hierarchy does not match. > [markup = > file:/D:/workspace/NetBeansProjects/WicketTest/build/web/WEB-INF/classes/com/myapp/wicket/HeaderPanel.html > > The html: > > > > Wicket Example > > Start of Example Title Goes Here > > > > > > > > > > > > > The MarkupComponents are: > # PathSizeTypeModel Object > 1 mainNavigation 3K com.myapp.wicket.HeaderPanel > No get > method defined for class: class com.myapp.wicket.HomePage expression: > mainNavigation > 2 mainNavigation:exampleTitle 421 bytes > org.apache.wicket.markup.html.basic.Label wicket > 3 mainNavigation:menu 4.4K > org.apache.wicket.markup.html.list.ListView > [EMAIL PROTECTED], > [EMAIL PROTECTED], > [EMAIL PROTECTED] > 4 mainNavigation:menu:0 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 5 mainNavigation:menu:0:label 418 bytes > org.apache.wicket.markup.html.basic.Label First Page > 6 mainNavigation:menu:0:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 7 mainNavigation:menu:1 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 8 mainNavigation:menu:1:label 419 bytes > org.apache.wicket.markup.html.basic.Label Second Page > 9 mainNavigation:menu:1:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 10mainNavigation:menu:2 4.4K > org.apache.wicket.markup.html.list.ListItem > [EMAIL PROTECTED] > 11mainNavigation:menu:2:label 418 bytes > org.apache.wicket.markup.html.basic.Label Third Page > 12mainNavigation:menu:2:link 1K > org.apache.wicket.markup.html.link.BookmarkablePageLink No get method > defined for class: class com.myapp.wicket.HomePage expression: link > 13param 409 bytes > org.apache.wicket.markup.html.basic.Label > 0 > 14stylesheet 1.4K > org.apache.wicket.markup.html.resources.StyleSheetReference No get > method defined for class: class com.myapp.wicket.HomePage expression: > stylesheet > > I have the following classes: > > public class HeaderPanel{ > public HeaderPanel(String componentName, String exampleTitle) > { > super(componentName); > add(new Label("exampleTitle", exampleTitle)); > ArrayList menu=new ArrayList(); > menu.add(new MenuModel("1", "HomePage", "First Page")); > menu.add(new MenuModel("2", "HomePage", "Second Page")); > menu.add(new MenuModel("3", "HomePage", "Third Page")); > > MenuView view = new MenuView("menu", menu); > add(view); > > } > } > > public class MenuView extends ListView { > > public MenuView(final String id) { > super(id); > } > > public MenuView(final String id, final IModel model) { > super(id, model); > } > > public MenuView(final String id, final List list) { > super(id, list); > } > > @Override > protected void populateItem(ListItem item) { > final MenuModel element = (MenuModel) item.getModelObject(); > Class clas; > try { > clas = Class.forName(elemen
"Unable to find component with id"
Hi I'm new in wicket. I tried to display a list of components, but I get the following error: WicketMessage: Unable to find component with id 'label' in [MarkupContainer [Component id = link, page = com.myapp.wicket.HomePage, path = 0:mainNavigation:menu:0:link.BookmarkablePageLink, isVisible = true, isVersioned = true]]. This means that you declared wicket:id=label in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match. [markup = file:/D:/workspace/NetBeansProjects/WicketTest/build/web/WEB-INF/classes/com/myapp/wicket/HeaderPanel.html The html: Wicket Example Start of Example Title Goes Here The MarkupComponents are: # PathSizeTypeModel Object 1 mainNavigation 3K com.myapp.wicket.HeaderPanel No get method defined for class: class com.myapp.wicket.HomePage expression: mainNavigation 2 mainNavigation:exampleTitle 421 bytes org.apache.wicket.markup.html.basic.Label wicket 3 mainNavigation:menu 4.4K org.apache.wicket.markup.html.list.ListView [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] 4 mainNavigation:menu:0 4.4K org.apache.wicket.markup.html.list.ListItem [EMAIL PROTECTED] 5 mainNavigation:menu:0:label 418 bytes org.apache.wicket.markup.html.basic.Label First Page 6 mainNavigation:menu:0:link 1K org.apache.wicket.markup.html.link.BookmarkablePageLink No get method defined for class: class com.myapp.wicket.HomePage expression: link 7 mainNavigation:menu:1 4.4K org.apache.wicket.markup.html.list.ListItem [EMAIL PROTECTED] 8 mainNavigation:menu:1:label 419 bytes org.apache.wicket.markup.html.basic.Label Second Page 9 mainNavigation:menu:1:link 1K org.apache.wicket.markup.html.link.BookmarkablePageLink No get method defined for class: class com.myapp.wicket.HomePage expression: link 10 mainNavigation:menu:2 4.4K org.apache.wicket.markup.html.list.ListItem [EMAIL PROTECTED] 11 mainNavigation:menu:2:label 418 bytes org.apache.wicket.markup.html.basic.Label Third Page 12 mainNavigation:menu:2:link 1K org.apache.wicket.markup.html.link.BookmarkablePageLink No get method defined for class: class com.myapp.wicket.HomePage expression: link 13 param 409 bytes org.apache.wicket.markup.html.basic.Label 0 14 stylesheet 1.4K org.apache.wicket.markup.html.resources.StyleSheetReference No get method defined for class: class com.myapp.wicket.HomePage expression: stylesheet I have the following classes: public class HeaderPanel{ public HeaderPanel(String componentName, String exampleTitle) { super(componentName); add(new Label("exampleTitle", exampleTitle)); ArrayList menu=new ArrayList(); menu.add(new MenuModel("1", "HomePage", "First Page")); menu.add(new MenuModel("2", "HomePage", "Second Page")); menu.add(new MenuModel("3", "HomePage", "Third Page")); MenuView view = new MenuView("menu", menu); add(view); } } public class MenuView extends ListView { public MenuView(final String id) { super(id); } public MenuView(final String id, final IModel model) { super(id, model); } public MenuView(final String id, final List list) { super(id, list); } @Override protected void populateItem(ListItem item) { final MenuModel element = (MenuModel) item.getModelObject(); Class clas; try { clas = Class.forName(element.getClas()); } catch (ClassNotFoundException ex) { Logger.getLogger(MenuView.class.getName()).log(Level.WARNING, null, ex); clas=this.getApplication().getHomePage(); } item.add(new Label("label", element.getLabel())); item.add(new BookmarkablePageLink("link", clas, new PageParameters("id=" + element.getId(; } } public class MenuModel implements Serializable{ public String clas; public String label; public String id; public MenuModel(String id, String clas, String label){ this.id=id; this.clas=clas; this.label=label; } public String getClas() { return clas; } public void setClas(String clas) { this.clas = clas; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public String getId() { return id; }