Quantcast

Newbie: WicketMessage: Unable to find component / What am I doing wrong?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Newbie: WicketMessage: Unable to find component / What am I doing wrong?

dorizev
Following the Wicket book by Förther, Menzel &  Siefart I have typed in their quickstart program and wanted to run it.
I got the error message below.
I don't understand this, since I *have declared* "myForm" on both HomePage.html and HomePage.java files (source code attached).
Does anybody have an idea what went wrong?
Thanks!
Dori

The error message is:

Unexpected RuntimeException

WicketMessage: Unable to find component with id 'myForm' in [Page class =
de.dpunkt.wicket.HomePage, id = 0, version = 0]. This means that you
declared wicket:id=myForm 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:/C:/development/workspaces/w/.metadata/.plugins/org.eclipse.wst.server.core/tmp4/wtpwebapps/wicket2/WEB-INF/classes/de/dpunkt/wicket/HomePage.html
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>
    <head>
        <title>Hello!</title>
    </head>
    <body>
        <strong>Hallo!</strong>
        <br/><br/>
        Hallo name will be here!
        <br/>
        <form wicket:id="myForm">
            Dein Name:
            <input type="text" wicket:id="nameField" autocomplete="off"/>
            <input type="submit" value="&Uuml;bernehmen"/>
        </form>
    </body>
</html>
, index = 9, current = '<form wicket:id="myForm">' (line 10, column 9)]
Root cause:
org.apache.wicket.markup.MarkupException: Unable to find component with id
'myForm' in [Page class = de.dpunkt.wicket.HomePage, id = 0, version = 0].
This means that you declared wicket:id=myForm 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:/C:/development/workspaces/w/.metadata/.plugins/org.eclipse.wst.server.core/tmp4/wtpwebapps/wicket2/WEB-INF/classes/de/dpunkt/wicket/HomePage.html
<html
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd"
>
    <head>
        <title>Hello!</title>
    </head>
    <body>
        <strong>Hallo!</strong>
        <br/><br/>
        Hallo name will be here!
        <br/>
        <form wicket:id="myForm">
            Dein Name:
            <input type="text" wicket:id="nameField" autocomplete="off"/>
            <input type="submit" value="&Uuml;bernehmen"/>
        </form>
    </body>
</html>
, index = 9, current = '<form wicket:id="myForm">' (line 10, column 9)]
     at
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:474)
     at
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1469)
     at
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1555)
     at org.apache.wicket.Page.onRender(Page.java:1594)
     at org.apache.wicket.Component.render(Component.java:2521)
     at org.apache.wicket.Page.renderPage(Page.java:932)
     at
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
     at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
     at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1259)
     at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
     at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
     at org.apache.wicket.RequestCycle.request(RequestCycle.java:546)
     at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
     at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:111)
     at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:589)
     at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
     at java.lang.Thread.run(Thread.java:662)



wicket.zip
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie: WicketMessage: Unable to find component / What am I doing wrong?

Erki
you are missing "add(myForm);" from the constructor in HomePage.java file
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie: WicketMessage: Unable to find component / What am I doing wrong?

dorizev
Thanks! That was the problem.
Dori
Loading...