Hi List,

I'm quite new to click and tried to create a Custom-Field, quite similar to the CalendarField, which needs javascripts and style-sheets.

So I've overriden the getHtmlImports() method to return my script and CSS and the result was quite odd.

The CSS (<link ...> is added to the <head>-Section as expected, but the <script ..> is missing.

This is what I returned as Imports:
"<link type=\"text/css\" rel=\"stylesheet\" href=\"/webui/styles/myField.css\"/>\n" + "<script type=\"text/javascript\" src=\"/webui/click/myField.js\"></script>\n"

(/webui is the context-path of my webapp)

Then I tried the same with the CalendarField (from Click Extensions) and got the same problem, CSS is used, but the scripts are missing.

CalendarField uses the following as HtmlImports:
"<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/calendar/calendar-{1}{7}.css\"/>\n" + "<script type=\"text/javascript\" src=\"{0}/click/control{7}.js\"></script>\n" + "<script type=\"text/javascript\" src=\"{0}/click/calendar/calendar{7}.js\"></script>\n" + "<script type=\"text/javascript\" src=\"{0}/click/calendar/calendar-{2}{7}.js\" charset=\"UTF-8\"></script>\n" + "<script type=\"text/javascript\">addLoadEvent( function() '{'Calendar.setup('{' inputField : ''{3}'', ifFormat : ''{4}'', showsTime : {5}, button : ''{3}-button'', align : ''cr'', singleClick : true, firstDay : {6} '}');'}');</script>\n";


Any idea what may cause this?

I am using 2.0.1-incubating as maven dependency.

Thanks in advance

SVen

Reply via email to