Re: ResourceReferenceRegistry

2012-03-08 Thread grazia

Still not clear what I did wrong. 
With wicket 1.4 my code was:

public final class PageHeaderComponent extends WebComponent {

 public PageHeaderComponent(final String id, final String
changeDestination) {
super(id);
add(CSSPackageResource.getHeaderContribution(/css/header.css));
}
(...)
}

and it created what I needed
link rel=stylesheet type=text/css href=/css/header.css /

Now with wicket 1.5, my code is:

public final class PageHeaderComponent extends WebComponent {

 public PageHeaderComponent(final String id, final String
changeDestination) {
super(id);
add(new Behavior() {
private final ResourceReference headerCss = new
PackageResourceReference(/css/header.css);

@Override
public void renderHead(Component component, IHeaderResponse
response) {
response.renderCSSReference(headerCss);
}
});
}
(...)
}

and it creates: 
link rel=stylesheet type=text/css
href=wicket/resource/org.apache.wicket.Application/css/header-ver-F274BBEF68106E265B1DB7EE2B7DF144.css
/

The warning being logged is: 

WARNING: Asked to auto-create a ResourceReference, but
ResourceReferenceRegistry
.createDefaultResourceReference() return null.  [scope:
org.apache.wicket.Application; name: css/header.css; locale: null; style:
null; variation: null]



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceReferenceRegistry-tp4453457p4457469.html
Sent from the Users forum 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



Re: ResourceReferenceRegistry

2012-03-07 Thread grazia
Thank you Martin. 
I think it is an issue of absolutePath. 

In 
 private final ResourceReference mouseOverMenuCss = new
CssResourceReference(getClass(),

   
/css/mouseovermenu.css);
  
the PackageResource.exists(scope, path, locale, style, variation)
will try to find my css reousrce in the path of the
PageHeaderComponentClass, which is not where my css is. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceReferenceRegistry-tp4453457p4453566.html
Sent from the Users forum 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



Re: ResourceReferenceRegistry

2012-03-07 Thread Martin Grigorov
The problem is at $2 in web.components.PageHeaderComponent$2
This is an inner anonymous class which name may vary.
Just use a stable class name and make sure the resource is next to the
.class file.

On Wed, Mar 7, 2012 at 5:34 PM, grazia grazia.russolass...@gmail.com wrote:
 Thank you Martin.
 I think it is an issue of absolutePath.

 In
  private final ResourceReference mouseOverMenuCss = new
 CssResourceReference(getClass(),

 /css/mouseovermenu.css);

 the PackageResource.exists(scope, path, locale, style, variation)
 will try to find my css reousrce in the path of the
 PageHeaderComponentClass, which is not where my css is.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ResourceReferenceRegistry-tp4453457p4453566.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: ResourceReferenceRegistry

2012-03-07 Thread grazia
what is the resource is not next to the .class file, but in a specific
directory external to the app, say in tomcat/webapps/css ? Is there another
wicket API I should use ?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ResourceReferenceRegistry-tp4453457p4454858.html
Sent from the Users forum 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



Re: ResourceReferenceRegistry

2012-03-07 Thread Martin Grigorov
See org.apache.wicket.markup.html.IHeaderResponse#renderCSSReference(String)

On Thu, Mar 8, 2012 at 12:09 AM, grazia grazia.russolass...@gmail.com wrote:
 what is the resource is not next to the .class file, but in a specific
 directory external to the app, say in tomcat/webapps/css ? Is there another
 wicket API I should use ?

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ResourceReferenceRegistry-tp4453457p4454858.html
 Sent from the Users forum 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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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