Hi everyone.

I am a little new on Wicket, and I have googling this problem a lot of time.

I have 3 or 4h try to solve this exception:
java.lang.IllegalArgumentException: A child with id 'eventos' already exists

But as you can see on code below, I am adding just a ListView component.

I ran this code step by step and I am noting that class constructor is
called twice. I don't know why, I am guess that the problem have to be with
that behaviour.

I am using wicket  6.7.0 on tomcat 7. Running on Windows 8.

Could you help me to solve this problem?


*This is the HTML code:*

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
     
xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
    <wicket:head>
        <link rel="stylesheet" type="text/css" href="tables.css"/> 
        <link rel="stylesheet" type="text/css" href="correos.css"/> 
        <link rel="stylesheet" type="text/css" href="ofertasPage.css"/> 
        
    </wicket:head>
    <body>
    <wicket:extend>
        <div id="main">
            <div id="leftside">
                <div class="grupo">
                    
Eventos

                    <wicket:link> Nueva evento <EventoPage.html> 
</wicket:link>
                    

                        
                            

                                        Nombre
                                        Tipo
                                        Correo
                                        Inicio de recepci&oacute;n
                                        Cierre de recepci&oacute;n
                                        Cierre de recepci&oacute;n              
              
                        
                        
                            

                                        Pedro Marcano
                                        Pedro Marcano
                                        0412/342-30-58
                                        0412/342-30-58
                                        0412/342-30-58
                                        
                                      <images/preview-5.png>  
                                      <images/edit-9.png>  
                                
                            
                        
                    

                    <wicket:link> Nuevo evento <EventoPage.html> 
</wicket:link>
                </div>
            </div>
        </div>
    </wicket:extend>
</body>
</html>

*And this is the class constructor*

public EventosPage() {
        LoadableDetachableModel<List&lt;Evento>> ldm = new
LoadableDetachableModel<List&lt;Evento>>() {
            @Override
            protected List<Evento> load() {
                return Evento.getAll();
            }
        };

        add(new ListView<Evento>("eventos", ldm) {
            
            @Override
            protected void populateItem(ListItem<Evento> item) {
                Evento ev = item.getModelObject();
                
                CompoundPropertyModel<Evento> cpm = new
CompoundPropertyModel<>(ev);
                
                item.add(new Label("nombre", cpm));
                item.add(new Label("tipo.nombre", cpm));
                item.add(new Label("correo", cpm));
                item.add(new Label("inicioRecepcion", cpm));
                item.add(new Label("finRecepcion", cpm));
                
                item.add(new BookmarkablePageLink("ver", EventoPage.class));
                item.add(new BookmarkablePageLink("editar",
EventoPage.class));
                
            
            }

           
        });


Thanks in advance,
Roger



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/A-child-with-id-XXXX-already-exist-AND-class-constructor-called-twice-issue-tp4659200.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

Reply via email to