Hi,
I just went through setting up datepicker yesterday. I was able to do
it but I had to make quite a few changes to the application which I have
given below. I also read somewhere that the Ajax theme is going to be
refactored to a plugin. I wanted to know what is the best pratice with
regard to appfuse and struts2. Should I use tools like scriptacalous
for autocomplete or use Struts2 Dojo UI tags?
Changes made to get datepicker working:
1. Change the extension from html to apsx
This ment that I had to change quite a few links in the
application. Everywhere there was a link with .html I had to change it
to .aspx.
2. Copied the files in struts.jar (org/apache/struts2/static/dojo) to
/scripts/dojo
(This did not work so I had to copy org/apache/struts2/static/dojo/src
to /src)
Now I have 2 copies of /scr folder but I have not checked what happens
if I delete the one in /scripts/dojo/
3. I changed the decorator.xml and added the following lines.
<pattern>/src/*</pattern>
<pattern>/scripts/dojo/*</pattern>
4. Added the line below to the head section of the page
<script type="text/javascript" src="<c:url
value='scripts/dojo/dojo.js'/>"></script>.
I tried
<s:head theme="ajax" calendarcss="calendar-green" debug="true"/>
but this is trying to get resources from
http://localhost:8080/struts/dojosrc/namespaces/dojo.js etc. because the
head renders the foll:
<script language="JavaScript" type="text/javascript">
// Dojo configuration
djConfig = {
baseRelativePath: "/struts/dojo",
isDebug: true,
bindEncoding: "UTF-8",
debugAtAllCosts: true // not needed, but allows the Venkman debugger to
work with the includes
};
</script>
<script language="JavaScript" type="text/javascript"
src="/struts/dojo/dojo.js"></script>
<script language="JavaScript" type="text/javascript"
src="/struts/simple/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
src="/struts/ajax/dojoRequire.js"></script>
<script language="JavaScript" type="text/javascript"
src="/struts/CommonFunctions.js"></script>
Looks like there the baseRelativePath needs to be changed from
/struts/dojo to /scripts/dojo/ this requires to change the head.ftm
This got the datepicker working but the calendar formatting was all wrong.
This requires some changes in the css files. Will be looking into this too.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]