You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bruce McGuire <br...@coastware.com> on 2008/02/05 21:17:11 UTC

Component failed to render

Hi there.

 

I am new to Wicket, and have been trying to create a new small application
to test it out before we switch completely to using Wicket and Hibernate
(through Databinder).

 

I am getting an error with my AccessDenied page, saying that a component
failed to render.

 

ERROR - RequestCycle               - 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 = homePageLink, page =
mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
isVisible = true, isVersioned = false]]

org.apache.wicket.WicketRuntimeException: 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 = homePageLink, page =
mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
isVisible = true, isVersioned = false]]

 

 

I have the component in the page, and have tried it within a div, span, etc,
in different places, and so on, but I cant get past this error.

 

If anyone has a pointer, I would greatly appreciate it.

 

Thanks,

 

Bruce.


RE: Component failed to render

Posted by Bruce McGuire <br...@coastware.com>.
Woops. Should have thought that the list server would strip attachments.

Here is the Java (without imports)
----------------
public class AccessDenied extends AccessDeniedPage implements Serializable
{
	private static final long serialVersionUID = 200802012L;

	public AccessDenied()
	{
		WebMarkupContainer wrapper = new
WebMarkupContainer("signedInWrapper")
		{
			private static final long serialVersionUID =
200802013L;

			public boolean isVisible()
			{
				SignInSession currSess =
(SignInSession)SignInSession.get() ;
				return (currSess.isSignedIn());
			}
		};
		add(wrapper);

		Link signout = new Link("signOut")
		{
			private static final long serialVersionUID =
200802014L;

			@Override
			public void onClick()
			{
				SignInSession currSess =
(SignInSession)SignInSession.get() ;
				mwh.WicketApplication wa =
(mwh.WicketApplication)currSess.getApplication() ;
				currSess.signOut();
				setResponsePage(wa.getSignInPageClass());
			}
		};

		wrapper.add(signout) ;

		Link pageHome = new Link("home")
		{
			private static final long serialVersionUID =
20080205L;

			@Override
			public void onClick()
			{
				SignInSession currSess =
(SignInSession)SignInSession.get() ;
				mwh.WicketApplication wa =
(mwh.WicketApplication)currSess.getApplication() ;
				setResponsePage(wa.getHomePage());
			}
		};

		wrapper.add(pageHome) ;

		Link signin = new Link("signIn")
		{
			private static final long serialVersionUID =
200802015L;

			@Override
			public void onClick()
			{
				SignInSession currSess =
(SignInSession)SignInSession.get() ;
				mwh.WicketApplication wa =
(mwh.WicketApplication)currSess.getApplication() ;
				currSess.signOut();
				setResponsePage(wa.getSignInPageClass());
			}

			@Override
			public boolean isVisible()
			{
				SignInSession currSess =
(SignInSession)SignInSession.get() ;
				return (!currSess.isSignedIn());
			}
		};

		add(signin) ;
	}

	@Override
	public boolean isErrorPage()
	{
		return (true) ;
	}
}
----------------

And the html:
----------------
	<body>
		<div wicket:id="signedInWrapper">
			<div>
				<a wicket:id="signOut" href="">Sign Out</a>
			</div>
			<div>
				<a wicket:id="home" href="">Home</a>
			</div>
		</div>
		<div>
			<a wicket:id="signIn" href="">Sign In</a>
		</div>
	</body>
----------------


Again, thanks for any pointers.

Bruce McGuire.

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Tuesday, 05 February, 2008 12:24 PM
To: users@wicket.apache.org
Subject: Re: Component failed to render

The attachments have gone AWOL, but I managed to take a look at them while
they were in the moderation queue.
s/home/homePageLink/

Martijn


On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
>
>  Hi there.
>
>
>
> I am new to Wicket, and have been trying to create a new small application
> to test it out before we switch completely to using Wicket and Hibernate
> (through Databinder).
>
>
>
> I am getting an error with my AccessDenied page, saying that a component
> failed to render.
>
>
>
> ERROR - RequestCycle               - 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 = homePageLink, page =
> mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
> isVisible = true, isVersioned = false]]
>
> org.apache.wicket.WicketRuntimeException: 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 = homePageLink, page =
> mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
> isVisible = true, isVersioned = false]]
>
>
>
>
>
> I have the component in the page, and have tried it within a div, span,
> etc, in different places, and so on, but I cant get past this error.
>
>
>
> If anyone has a pointer, I would greatly appreciate it.
>
>
>
> Thanks,
>
>
>
> Bruce.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0


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


Re: Component failed to render

Posted by Martijn Dashorst <ma...@gmail.com>.
The attachments have gone AWOL, but I managed to take a look at them while
they were in the moderation queue.
s/home/homePageLink/

Martijn


On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
>
>  Hi there.
>
>
>
> I am new to Wicket, and have been trying to create a new small application
> to test it out before we switch completely to using Wicket and Hibernate
> (through Databinder).
>
>
>
> I am getting an error with my AccessDenied page, saying that a component
> failed to render.
>
>
>
> ERROR - RequestCycle               - 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 = homePageLink, page =
> mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
> isVisible = true, isVersioned = false]]
>
> org.apache.wicket.WicketRuntimeException: 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 = homePageLink, page =
> mwh.page.error.AccessDenied, path = 3:homePageLink.BookmarkablePageLink,
> isVisible = true, isVersioned = false]]
>
>
>
>
>
> I have the component in the page, and have tried it within a div, span,
> etc, in different places, and so on, but I cant get past this error.
>
>
>
> If anyone has a pointer, I would greatly appreciate it.
>
>
>
> Thanks,
>
>
>
> Bruce.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

RE: Component failed to render

Posted by Bruce McGuire <br...@coastware.com>.
Hi Martijn.

I don't have the source for the page, I was going by the docs for
AccessDeniedPage at
http://people.apache.org/~tobrien/wicket/apidocs/index.html.

Bruce.

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Tuesday, 05 February, 2008 04:32 PM
To: users@wicket.apache.org
Subject: Re: Component failed to render

Did it add components by itself in the super constructor?

Martijn

On 2/6/08, Bruce McGuire <br...@coastware.com> wrote:
> Hello.
>
> FYI, my problem was not that the ids didn't match. Not exactly sure what
the
> problem was, but as soon as I stopped extending AccessDeniedPage, and
> instead extended WebPage, the page rendered properly.
>
> Not sure why extending AccessDeniedPage was a bad thing, but it was.
>
> Bruce.
>
> -----Original Message-----
> From: Bruce McGuire [mailto:bruce@coastware.com]
> Sent: Tuesday, 05 February, 2008 12:58 PM
> To: users@wicket.apache.org
> Subject: RE: Component failed to render
>
> Great. Thanks Martijn.
>
> Bruce.
>
> -----Original Message-----
> From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> Sent: Tuesday, 05 February, 2008 12:52 PM
> To: users@wicket.apache.org
> Subject: Re: Component failed to render
>
> Wicket doesn't care about the alpha and the gamma, but the beta and delta
> need to be in alignment, or more specifically: ==
>
> On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
> >
> > Hi Martijn.
> >
> > Thanks for the response.
> >
> > Do you mean that
> >         Link alpha = new Link("beta")
> >         <a wicket:id="delta" href="">gamma</a>
> >
> > where these two lines have to match is in the declaration of the Link?
Ie
> > the alpha == delta?  Not beta == delta?
> >
> > Thanks,
> >
> > Bruce.
> > -----Original Message-----
> > From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> > Sent: Tuesday, 05 February, 2008 12:43 PM
> > To: users@wicket.apache.org
> > Subject: Re: Component failed to render
> >
> > s/home/homePageLink/
> > Your link id in java doesn't match link id in markup
> >
> > Martijn
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

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


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


Re: Component failed to render

Posted by Martijn Dashorst <ma...@gmail.com>.
Did it add components by itself in the super constructor?

Martijn

On 2/6/08, Bruce McGuire <br...@coastware.com> wrote:
> Hello.
>
> FYI, my problem was not that the ids didn't match. Not exactly sure what the
> problem was, but as soon as I stopped extending AccessDeniedPage, and
> instead extended WebPage, the page rendered properly.
>
> Not sure why extending AccessDeniedPage was a bad thing, but it was.
>
> Bruce.
>
> -----Original Message-----
> From: Bruce McGuire [mailto:bruce@coastware.com]
> Sent: Tuesday, 05 February, 2008 12:58 PM
> To: users@wicket.apache.org
> Subject: RE: Component failed to render
>
> Great. Thanks Martijn.
>
> Bruce.
>
> -----Original Message-----
> From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> Sent: Tuesday, 05 February, 2008 12:52 PM
> To: users@wicket.apache.org
> Subject: Re: Component failed to render
>
> Wicket doesn't care about the alpha and the gamma, but the beta and delta
> need to be in alignment, or more specifically: ==
>
> On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
> >
> > Hi Martijn.
> >
> > Thanks for the response.
> >
> > Do you mean that
> >         Link alpha = new Link("beta")
> >         <a wicket:id="delta" href="">gamma</a>
> >
> > where these two lines have to match is in the declaration of the Link? Ie
> > the alpha == delta?  Not beta == delta?
> >
> > Thanks,
> >
> > Bruce.
> > -----Original Message-----
> > From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> > Sent: Tuesday, 05 February, 2008 12:43 PM
> > To: users@wicket.apache.org
> > Subject: Re: Component failed to render
> >
> > s/home/homePageLink/
> > Your link id in java doesn't match link id in markup
> >
> > Martijn
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

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


RE: Component failed to render

Posted by Bruce McGuire <br...@coastware.com>.
Hello.

FYI, my problem was not that the ids didn't match. Not exactly sure what the
problem was, but as soon as I stopped extending AccessDeniedPage, and
instead extended WebPage, the page rendered properly.

Not sure why extending AccessDeniedPage was a bad thing, but it was.

Bruce.

-----Original Message-----
From: Bruce McGuire [mailto:bruce@coastware.com] 
Sent: Tuesday, 05 February, 2008 12:58 PM
To: users@wicket.apache.org
Subject: RE: Component failed to render

Great. Thanks Martijn.

Bruce.

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Tuesday, 05 February, 2008 12:52 PM
To: users@wicket.apache.org
Subject: Re: Component failed to render

Wicket doesn't care about the alpha and the gamma, but the beta and delta
need to be in alignment, or more specifically: ==

On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
>
> Hi Martijn.
>
> Thanks for the response.
>
> Do you mean that
>         Link alpha = new Link("beta")
>         <a wicket:id="delta" href="">gamma</a>
>
> where these two lines have to match is in the declaration of the Link? Ie
> the alpha == delta?  Not beta == delta?
>
> Thanks,
>
> Bruce.
> -----Original Message-----
> From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> Sent: Tuesday, 05 February, 2008 12:43 PM
> To: users@wicket.apache.org
> Subject: Re: Component failed to render
>
> s/home/homePageLink/
> Your link id in java doesn't match link id in markup
>
> Martijn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0


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


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


RE: Component failed to render

Posted by Bruce McGuire <br...@coastware.com>.
Great. Thanks Martijn.

Bruce.

-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Tuesday, 05 February, 2008 12:52 PM
To: users@wicket.apache.org
Subject: Re: Component failed to render

Wicket doesn't care about the alpha and the gamma, but the beta and delta
need to be in alignment, or more specifically: ==

On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
>
> Hi Martijn.
>
> Thanks for the response.
>
> Do you mean that
>         Link alpha = new Link("beta")
>         <a wicket:id="delta" href="">gamma</a>
>
> where these two lines have to match is in the declaration of the Link? Ie
> the alpha == delta?  Not beta == delta?
>
> Thanks,
>
> Bruce.
> -----Original Message-----
> From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> Sent: Tuesday, 05 February, 2008 12:43 PM
> To: users@wicket.apache.org
> Subject: Re: Component failed to render
>
> s/home/homePageLink/
> Your link id in java doesn't match link id in markup
>
> Martijn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0


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


Re: Component failed to render

Posted by Martijn Dashorst <ma...@gmail.com>.
Wicket doesn't care about the alpha and the gamma, but the beta and delta
need to be in alignment, or more specifically: ==

On 2/5/08, Bruce McGuire <br...@coastware.com> wrote:
>
> Hi Martijn.
>
> Thanks for the response.
>
> Do you mean that
>         Link alpha = new Link("beta")
>         <a wicket:id="delta" href="">gamma</a>
>
> where these two lines have to match is in the declaration of the Link? Ie
> the alpha == delta?  Not beta == delta?
>
> Thanks,
>
> Bruce.
> -----Original Message-----
> From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com]
> Sent: Tuesday, 05 February, 2008 12:43 PM
> To: users@wicket.apache.org
> Subject: Re: Component failed to render
>
> s/home/homePageLink/
> Your link id in java doesn't match link id in markup
>
> Martijn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

RE: Component failed to render

Posted by Bruce McGuire <br...@coastware.com>.
Hi Martijn.

Thanks for the response.

Do you mean that 
	Link alpha = new Link("beta")
	<a wicket:id="delta" href="">gamma</a>

where these two lines have to match is in the declaration of the Link? Ie
the alpha == delta?  Not beta == delta?

Thanks,

Bruce.
-----Original Message-----
From: Martijn Dashorst [mailto:martijn.dashorst@gmail.com] 
Sent: Tuesday, 05 February, 2008 12:43 PM
To: users@wicket.apache.org
Subject: Re: Component failed to render

s/home/homePageLink/
Your link id in java doesn't match link id in markup

Martijn


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


Re: Component failed to render

Posted by Martijn Dashorst <ma...@gmail.com>.
s/home/homePageLink/
Your link id in java doesn't match link id in markup

Martijn