Well, you need to have some html in the container with wicket:id="win1" for
your code to work. Wicket is (correctly) complaining that it cannot locate
html for your component. What kind of component is Window? (it's not a
standard wicket component)
marioosh.net wrote:
>
>
>
> 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: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>
>
>
> 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-tp26886670p26888242.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]