marioosh.net wrote:
> 
> I have a Window component (Panel subclass) and button to dynamic
> adding new Window to Base page,
> but when i click this button (AjaxLink) i get error:
> 
> WicketMessage: Unable to find the markup for the component. That may
> be due to transparent containers or components implementing
> IComponentResolver: [MarkupContainer [Component id = win1]]
> 
> Base.html:
> <body>
>        # new 
> </body>
> 
> Base.java:
> public class Base extends WebPage {
>       public Base() {
>               
>               add(new AjaxLink("new"){
>                       @Override
>                       public void onClick(AjaxRequestTarget target) {
>                               Window win = new Window("win1","title");
>                               win.setOutputMarkupId(true);
>                               add(win);
>                               target.addComponent(win); // ajax refresh
>                       }
>               });
>       }
> }
> 
> -- 
> Greetings,
> marioosh
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 


I changed my code, but now i get error:
WicketMessage: 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. [MarkupContainer [Component id = win1]]
...

Base.java:
public class Base extends WebPage {
        public Base() {

                final WebMarkupContainer m = new 
WebMarkupContainer("container");               
                m.setOutputMarkupId(true);
                add(m);
                add(new AjaxLink("new"){
                        @Override
                        public void onClick(AjaxRequestTarget target) {
                                Window win = new Window("win1","...");
                                m.add(win);
                                target.addComponent(m);
                        }
                });
        }
}

Base.html:
<body>
         # new 
           <wicket:container wicket:id="container"/>    
</body>

Anybody help with that ?

-- 
View this message in context: 
http://old.nabble.com/Adding-components-to-page-%28dynamically%29-tp26886670p26886911.html
Sent from the Wicket - User 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