You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2017/04/30 18:39:33 UTC

Wicket Modal throws exception

I am addding a Wicket Modal.  I go to render it on button click and amd
getting the below trace.  But I don't have _header_ in my page, in the
modal, or anywhere in my app actually (I searched the whole workspace), so
I'm not sure where it comes from, and therefore am not sure how to fix it.

org.apache.wicket.WicketRuntimeException: Cannot replace a component which
has not been added: id='_header_', component=[HtmlHeaderContainer [Component
id = _header_]]:
[Page class = com.mycompany.mypage, id = 0, render count = 1]
	at org.apache.wicket.MarkupContainer.replace(MarkupContainer.java:734)
	at
org.apache.wicket.ajax.AbstractAjaxResponse.writeTo(AbstractAjaxResponse.java:170)
	at
org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:359)
	at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:890)
	at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
	at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97)
	at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
	at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
	at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
	at
org.apache.wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:159)

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Modal-throws-exception-tp4677764.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket Modal throws exception

Posted by Martin Grigorov <mg...@apache.org>.
Please start new threads for new issues!

Double check that this particular component indeed renders its HTML element.
No matter what Java methods you call on the component it won't render if
the used HTML element is <wicket:xyz>. Depending on your MarkupSettings
this elements are usually not rendered.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, May 1, 2017 at 9:06 PM, Entropy <bl...@gmail.com> wrote:

> Upgrading seems to fix this specific issue.  However, I am no getting
> another
> odd behavior.  I am trying to update some text and button captions on the
> page.  It's working, but gives an error in javascript despite the working.
>
> Wicket.Ajax:  Wicket.Ajax.Call.processComponent: Component with id
> [[message]] was not found while trying to perform markup update. Make sure
> you called component.setOutputMarkupId(true) on the component whose markup
> you are trying to update.
>
> It says that, but in fact, I DID call setOutputMarkupId(true) on not just
> that component, but EVERY component in the modal, overkill though it may
> be.
> I also called setOutputPlaceholderTag and setMarkupId just in case.
> Neither
> changed anything.
>
> The confusing part is that the label change AND the button caption changes
> ARE working.
>
> The relevant part of the ajax event:
>
>                 message.setDefaultModelObject(modalWindow.getMessage());
>                 button.setVisible(true);
>                 button.setDefaultModel(new Model(modalWindow.
> getButtonCaption()));
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-Modal-throws-exception-tp4677764p4677770.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket Modal throws exception

Posted by Entropy <bl...@gmail.com>.
Upgrading seems to fix this specific issue.  However, I am no getting another
odd behavior.  I am trying to update some text and button captions on the
page.  It's working, but gives an error in javascript despite the working.

Wicket.Ajax:  Wicket.Ajax.Call.processComponent: Component with id
[[message]] was not found while trying to perform markup update. Make sure
you called component.setOutputMarkupId(true) on the component whose markup
you are trying to update.

It says that, but in fact, I DID call setOutputMarkupId(true) on not just
that component, but EVERY component in the modal, overkill though it may be. 
I also called setOutputPlaceholderTag and setMarkupId just in case.  Neither
changed anything.  

The confusing part is that the label change AND the button caption changes
ARE working.  

The relevant part of the ajax event:

		message.setDefaultModelObject(modalWindow.getMessage());
		button.setVisible(true);
		button.setDefaultModel(new Model(modalWindow.getButtonCaption()));



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Modal-throws-exception-tp4677764p4677770.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket Modal throws exception

Posted by Martin Grigorov <mg...@apache.org>.
First "workaround" that everyone should try whenever something behaves
wrong is to upgrade to the latest stable version! In your case this is
6.26.0.

If this doesn't help then try to reproduce the problem in a small demo app.
Share it somehow with us (JIRA ticket, GitHub project, ...) and someone
will either fix the app for you or fix Wicket!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, May 1, 2017 at 1:36 PM, Entropy <bl...@gmail.com> wrote:

> 6.24.  Is there a workaround?  We're using modals elsewhere.  I am trying
> to
> make one that will be more general purpose, but it otherwise seems the same
> as our others and I am not sure what is so different about it.
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-Modal-throws-exception-tp4677764p4677768.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket Modal throws exception

Posted by Entropy <bl...@gmail.com>.
6.24.  Is there a workaround?  We're using modals elsewhere.  I am trying to
make one that will be more general purpose, but it otherwise seems the same
as our others and I am not sure what is so different about it.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-Modal-throws-exception-tp4677764p4677768.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket Modal throws exception

Posted by Martin Grigorov <mg...@apache.org>.
Wicket version ?

I think there was a bug related to that that has been fixed an year (?!)
ago.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sun, Apr 30, 2017 at 8:39 PM, Entropy <bl...@gmail.com> wrote:

> I am addding a Wicket Modal.  I go to render it on button click and amd
> getting the below trace.  But I don't have _header_ in my page, in the
> modal, or anywhere in my app actually (I searched the whole workspace), so
> I'm not sure where it comes from, and therefore am not sure how to fix it.
>
> org.apache.wicket.WicketRuntimeException: Cannot replace a component which
> has not been added: id='_header_', component=[HtmlHeaderContainer
> [Component
> id = _header_]]:
> [Page class = com.mycompany.mypage, id = 0, render count = 1]
>         at org.apache.wicket.MarkupContainer.replace(
> MarkupContainer.java:734)
>         at
> org.apache.wicket.ajax.AbstractAjaxResponse.writeTo(
> AbstractAjaxResponse.java:170)
>         at
> org.apache.wicket.ajax.AjaxRequestHandler.respond(
> AjaxRequestHandler.java:359)
>         at
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(
> RequestCycle.java:890)
>         at
> org.apache.wicket.request.RequestHandlerStack.execute(
> RequestHandlerStack.java:64)
>         at
> org.apache.wicket.request.RequestHandlerStack.execute(
> RequestHandlerStack.java:97)
>         at
> org.apache.wicket.request.cycle.RequestCycle.execute(
> RequestCycle.java:261)
>         at
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.
> java:218)
>         at
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(
> RequestCycle.java:289)
>         at
> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(
> WicketFilter.java:259)
>         at
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.
> java:201)
>         at
> org.apache.wicket.protocol.http.WicketServlet.doPost(
> WicketServlet.java:159)
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-Modal-throws-exception-tp4677764.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>