use of org.apache.wicket.resource.JQueryPluginResourceReference in project wicket by apache.
the class HomePage method renderHead.
@Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
// example of things that may be shared for all your applications across your company,
// two CSS resources in the same group. header.css is rendered first because has lower
// "order" number
response.render(CssHeaderItem.forReference(new CssResourceReference(HomePage.class, "footer.css")));
response.render(CssHeaderItem.forReference(new CssResourceReference(HomePage.class, "header.css")));
// example of something that may be in this single application:
response.render(CssHeaderItem.forReference(new CssResourceReference(HomePage.class, "app.css")));
// example of something that may be limited to certain pages:
response.render(CssHeaderItem.forReference(new CssResourceReference(HomePage.class, "HomePage.css")));
response.render(JavaScriptHeaderItem.forReference(new JQueryPluginResourceReference(HomePage.class, "HomePage.js")));
response.render(new FilteredHeaderItem(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(HomePage.class, "top.js")), FilteringHeaderResponse.DEFAULT_HEADER_FILTER_NAME));
}
use of org.apache.wicket.resource.JQueryPluginResourceReference in project wicket by apache.
the class FilteredHeaderPage method renderHead.
@Override
public void renderHead(IHeaderResponse response) {
// rendered at the default header bucket
final JavaScriptResourceReference topJsReference = new JavaScriptResourceReference(FilteredHeaderPage.class, "top.js");
response.render(new FilteredHeaderItem(JavaScriptHeaderItem.forReference(topJsReference), FilteringHeaderResponse.DEFAULT_HEADER_FILTER_NAME));
// rendered at the bottom of the body bucket
JQueryPluginResourceReference bottomJs = new JQueryPluginResourceReference(FilteredHeaderPage.class, "bottom.js") {
private static final long serialVersionUID = 1L;
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = super.getDependencies();
// WICKET-4566 : depend on a resource which is rendered in a different bucket
dependencies.add(JavaScriptHeaderItem.forReference(topJsReference));
return dependencies;
}
};
response.render(JavaScriptHeaderItem.forReference(bottomJs));
}
Aggregations