I solved the problem myself.
- dg

 

-----Ursprüngliche Nachricht-----
Von: Dorothée Giernoth [mailto:dorothee.giern...@kds-kg.de] 
Gesendet: Montag, 25. Mai 2009 11:41
An: users@wicket.apache.org
Betreff: AW: MarkupException, BUT WHY???

Oh yeah, that might be helpful:
Here is the exception message:

WicketMessage: Unable to find component with id 'heading' in [MarkupContainer 
[Component id = _extend3]]. This means that you declared wicket:id=heading 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:/workspace/MyApp/context/WEB-INF/classes/myapp/dbtest/ListTabelle.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/postage.css">
<title>Datenbank-Designer</title>

</head>
<body>
<div wicket:id="feedback"></div>
<p>Willkommen beim DB-Designer 1.0! (c) by dg</p>
<p><b>Was möchten Sie tun:</b></p>

<form wicket:id="fa">
<select wicket:id="ddc1">
<option></option>
</select>
<input type="submit" value="Ok"/>
</form>
<br>
<form wicket:id="fb">
<div>Die in der Datenbank vorhandenen Tabellen:</div>
<select wicket:id="tables">
<option></option>
</select>
<input type="submit" value="Optionen anzeigen"/>
</form>
<br>
<form wicket:id="fc">
<select wicket:id="options">
<option></option>
</select>
<input type="submit" value="Ok"/>
</form>

<wicket:child><wicket:extend>

<div wicket:id="infoText"></div>
<table>
<tr>
<th wicket:id="heading">
</th>
</tr>
<tr wicket:id="row">
<td wicket:id="cell">
</td>
</tr>
</table>
</wicket:extend></wicket:child>

</body>
</html>, index = 40, current = '<th wicket:id="heading">' (line 6, column 7)]

Root cause:

org.apache.wicket.markup.MarkupException: Unable to find component with id 
'heading' in [MarkupContainer [Component id = _extend3]]. This means that you 
declared wicket:id=heading 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:/workspace/MyApp/context/WEB-INF/classes/myapp/dbtest/ListTabelle.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/postage.css">
<title>Datenbank-Designer</title>

</head>
<body>
<div wicket:id="feedback"></div>
<p>Willkommen beim DB-Designer 1.0! (c) by dg</p>
<p><b>Was möchten Sie tun:</b></p>

<form wicket:id="fa">
<select wicket:id="ddc1">
<option></option>
</select>
<input type="submit" value="Ok"/>
</form>
<br>
<form wicket:id="fb">
<div>Die in der Datenbank vorhandenen Tabellen:</div>
<select wicket:id="tables">
<option></option>
</select>
<input type="submit" value="Optionen anzeigen"/>
</form>
<br>
<form wicket:id="fc">
<select wicket:id="options">
<option></option>
</select>
<input type="submit" value="Ok"/>
</form>

<wicket:child><wicket:extend>

<div wicket:id="infoText"></div>
<table>
<tr>
<th wicket:id="heading">
</th>
</tr>
<tr wicket:id="row">
<td wicket:id="cell">
</td>
</tr>
</table>
</wicket:extend></wicket:child>

</body>
</html>, index = 40, current = '<th wicket:id="heading">' (line 6, column 7)]
at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:464)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1344)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1401)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:223)
at 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:66)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1324)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1476)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1401)
at org.apache.wicket.Component.renderComponent(Component.java:2480)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1411)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:223)
at 
org.apache.wicket.markup.resolver.MarkupInheritanceResolver.resolve(MarkupInheritanceResolver.java:73)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1324)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1427)
at org.apache.wicket.Page.onRender(Page.java:1470)
at org.apache.wicket.Component.render(Component.java:2317)
at org.apache.wicket.Page.renderPage(Page.java:904)
at 
org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:163)
at 
org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:58)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:104)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1181)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1252)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1353)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:355)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:200)
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:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)



-----Ursprüngliche Nachricht-----
Von: Martin Makundi [mailto:martin.maku...@koodaripalvelut.com] 
Gesendet: Montag, 25. Mai 2009 11:22
An: users@wicket.apache.org
Betreff: Re: MarkupException, BUT WHY???

What's the exception message?

2009/5/25 Dorothée Giernoth <dorothee.giern...@kds-kg.de>:
> Hey all,
>
> I am quite new to Wicket, but I am trying some stuff to see how it works. 
> Right now I am trying my best to build a little database-designer, but I get 
> a MarkupException, but I dunno why. I am using MarkupInheritance ...
> My Code doesn't look very tidy, but I am still brave enough to post it. Hope 
> someone sees where it fails. Thank you in advance!
>
> My first class-file, where it calls the second class-file, that includes the 
> code, that will be loaded into the original html-file:
> -------------------------------------------------------------------------
> // DBDesigner.java:
> protected void onSubmit(){
>        String o = ( String ) drop3.getObject();
>        if( o.equals( "Datensaetze nur anzeigen" )){
>                try{
>                        String tab = tableList.get( tabelle );
>                        /* RESPONSEPAGE CALLED HERE!!!!*/
>                        ListTabelle listing = new ListTabelle( tab );
>                        setResponsePage( listing );
>                }
>                catch(Exception e){
>                        System.out.println( "TIENES UNA PROBLEMA: " + e );
>                }
>        }
> }
> --------------------------------------------------------------------------
>
>
> It calls ListTabelle.java where I load data from a database according to the 
> choice of the user (the user chooses a table to collect to data from). I 
> build up a RepeatingView that holds the data.
> I tried to just print the data in a label for shit and giggles and it worked, 
> but something doesn't work with my RepeatingView (or with all the other 
> Components I tried ...). I am missing something and tried for days now to 
> figure out where my brain fails ... I just can't see it.
> Here is the code from ListTabelle.java (at least, what could be interesting):
> --------------------------------------------------------------------------
> package ...;
> import ...;
>
>
> public class ListTabelle extends DBDesigner implements Serializable{
>
>        // VARIABLES ...
>
>  /**
>   * Constructor
>   * @param conMe
>   * @param tab
>   */
>  public ListTabelle( String tab ){
>        this.tab = tab;
>
>        try {
>
>                /*
>                 *  CONNECTION TO DB:
>                 */
>                ...
>
>              try{
>                        showData();
>
>                        int sizeH = tabellenHeader.size();
>                        int sizeC = list.size();
>
>                        RepeatingView heading = new RepeatingView( "heading" );
>                        for( int i = 0; i <= sizeH; i++ ){
>                          heading.add( new Label( heading.newChildId(),
>                                                           tabellenHeader.get( 
> i ) ) );
>                        }
>                        add( heading );
>                        RepeatingView row = new RepeatingView( "row" );
>                        add( row );
>
>                        for( int j = 0; j <= sizeC; j++ ){
>                          WebMarkupContainer r = new WebMarkupContainer(
>                                                                        
> row.newChildId() );
>                          RepeatingView cell = new RepeatingView( "cell" );
>                          row.add(r);
>                          r.add(cell);
>                          cell.add( new Label( cell.newChildId(),
>                                                        list.get( j ) ) )      
>                                            for( int d = 0; d <= sizeC; d++ ){
>                             cell.add( new Label( cell.newChildId(),
>                                                          list.get( j )  ) );
>                          }
>                        }
>
>
>
>                        /*
>                         * close the database
>                         */
>                        conMe.close();
>                    }
>                    catch( Exception e ){
>                        e.printStackTrace();
>                    }
>        }
>
>
>        /**
>         * Bastelt die Ausgabe-Liste aus der Datenbank zusammen.
>         */
>        private void showData(){
>
>                add( new Label( "infoText", "Ihre Daten werden angezeigt!" ) );
>
>                list = new ArrayList<String>();
>                tabellenHeader = new ArrayList<String>();
>                try {
>                        Statement cs = conMe.createStatement();
>                        // Tabellen-Header abfragen:
>                        ResultSet header = cs.executeQuery(
>                                                "SHOW COLUMNS FROM " + tab + 
> ";" );
>                        anzahlSpalten = 0;
>                        while( header.next() ){
>                        anzahlSpalten++;
>                        tabellenHeader.add( inhalt );
>                        list.add( inhalt );
>                }
>
>            // Tabellen-Inhalt:
>            ResultSet tcontent = cs.executeQuery(
>                                                "SELECT * FROM " + tab + ";" );
>            // tcontent.next() - ist immer die neue Zeile, die dann
>            // spaltenweise ausgelesen werden kann.
>            while( tcontent.next() ){
>                for( int i = 0; i < anzahlSpalten; i++ ){
>                        list.add( tcontent.getString(
>                                                        
> tabellenHeader.get(i)));
>                }
>            }
>
>            System.out.println("Die ausgelesenen Daten: \n" + test);
>
>
>        }
>        catch( SQLException e ){
>                System.out.println( "Fehler SQL-Befehl: " + e );
>        }
>        }
> }
> --------------------------------------------------------------------------
>
>
> I put <wicket:child></wicket:child> into my DBDesigner.html-File and my 
> ListTabelle.html looks like this:
> --------------------------------------------------------------------------
> <wicket:extend>
>        <div wicket:id="infoText"></div>
>        <table>
>                <tr>
>                        <th wicket:id="heading">
>                        </th>
>                </tr>
>                <tr wicket:id="row">
>                        <td wicket:id="cell">
>                        </td>
>                </tr>
>        </table>
> </wicket:extend>
> --------------------------------------------------------------------------
>
> I know this is a lot to read right now, but please bear with me ... I am just 
> a baby-wicket-nerd and I am really desperate! I bet it is just a simple 
> little thing, like - I dunno - a quotation mark ...
> I hope someone can help me.
> Thnx in advance again :)
>
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
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

Reply via email to