Hello,

I'm currently migrating a code snippet from version 1.4 to version 6:


add( TextTemplateHeaderContributor.forJavaScript( ClassName.class,
                "filename.js", new LoadableDetachableModel<Map<String,
Object>>() {
                    @Override
                    protected Map<String, Object> load() {
                        final Map<String, Object> result = new
HashMap<String, Object>();
                        result.put( "id", "static string ...." );
                        // more parameters here
                        return result;
                    }
                } ) );

The migration documentation (
https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+1.5#MigrationtoWicket1.5-RemovedTextTemplateHeaderContributor/StringHeaderContributor
) suggests using a custom template, e.g.
private TextTemplate template = CssTemplate(new MyTextTemplate());

Unfortunately, I can't find a TextTemplate which mimics the behavior in my
1.4 code snippet. I found a JavaScriptTemplate, but I was unable to find a
way to use it, as it needs a TextTemplate instance in its constructor.

Thanks,
David

Reply via email to