History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: APF-739
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Matt Raible
Reporter: J. David Mendoza R.
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
AppFuse

Struts2 tags (autocompleter, datetimepicker) don't work out-of-the-box (dojo scripts not loading)

Created: 26/Apr/07 03:37 PM   Updated: 13/Jun/07 09:58 AM
Component/s: Web - Struts
Affects Version/s: 2.0-M4
Fix Version/s: 2.0-M5


 Description  « Hide
It appears that Sitemesh and the StaticFilter are working together to forbid the Dojo scripts embedded in struts2.jar to load.

 All   Comments   Change History   FishEye      Sort Order:
J. David Mendoza R. - 26/Apr/07 03:40 PM
The solution I found:

- Change the parser in sitemesh.xml to (commented out the 3 lines of HTMLPageParser):
   <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/>
- Added struts/dojo/* to the excludes part in the decorators.xml file.
   <excludes>
       <pattern>/struts/dojo/*</pattern>
       <pattern>/resources/*</pattern>
   </excludes>
- And changed back the includes param of the StaticFilter in the web.xml from /scripts/dojo/* to /struts/dojo/*
       <init-param>
           <param-name>includes</param-name>
           <param-value>/struts/dojo/*</param-value>
       </init-param>

Matt Raible - 30/May/07 05:23 PM
This still does not work out-of-the-box with M5. Solution provided by Jason Thrasher:

http://www.nabble.com/Re%3A-ajax-and-datepicker-on-2m4-p10828138.html

Jason Thrasher - 30/May/07 06:34 PM
To see dojo's debug output, add this to the default.jsp:

<authz:authorize ifAllGranted="ROLE_ADMIN">
   <div id="dojoDebugOutput"></div>
</authz:authorize>

It would be nice to have a "debug mode" for the webapp's UI, instead of relying on Roles though.

Matt Raible - 06/Jun/07 05:07 PM
Changed to use jscalendar for datepicker in Struts. Also, I recommend using Scriptaculous for Autocompletion. Copying dojo to an AppFuse application will work, but at 5 MB, it doesn't seem worth the effort. Most of Struts tags that use Dojo are buggy or slow.

See the following URL for more information:

http://www.nabble.com/Moving-from-Canoo-WebTest-to-Selenium-tf3844464s2369.html#a10887242

Matt Raible - 13/Jun/07 09:58 AM
Dojo has been integrated to the following branch:

https://appfuse.dev.java.net/svn/appfuse/branches/dojo-integration/

Use username "guest" and no password if you want to browse the above URL. You can also check it out from Subversion using these same credentials.