You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Stefan Fussenegger <st...@molindo.at> on 2009/07/07 17:16:56 UTC

Why does Component#renderHead() honor isVisible() but ignores isRenderAllowed() and isVisibilityAllowed()?

Hi all,

I was about to file a JIRA issue for this, but I thought I ask on the 
mailing list first. Is it really possible, that nobody discovered this 
before? I have this strange feeling that this is as designed. However, I 
don't think there is any point in adding CSS or JS for components a user 
isn't allowed to see (e.g. embedded admin components).

Should I file a bug for it?

In the meantime, here is a workaround, to manually exclude the resources 
added to a component:

public void renderHead(final HtmlHeaderContainer container) {
	if (determineVisibility()) {
		super.renderHead(container);
	}
}

Cheers

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


Re: Why does Component#renderHead() honor isVisible() but ignores isRenderAllowed() and isVisibilityAllowed()?

Posted by Stefan Fussenegger <st...@molindo.at>.
ah, seems it has been changed in 1.4 (trunk) - sorry for not checking 
this before. Is it too late for 1.3 to get the same behavior as in 1.4?

trunk:
http://svn.apache.org/repos/asf/wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java

wicket-1.3.x branch:
http://svn.apache.org/repos/asf/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java

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