Dojo Struts 2.0.12

In my struts 2.0.12 app, I try to use s: datetimepicker but it doesn't show up.

Firebug error: dojo is not defined on dojo.require ("dojo.widget.DatePicker");

My jsp page

 <%@taglib prefix="s" uri="/struts-tags" %>
 .
 .
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <s:head theme="ajax" debug="true"/>
 .
 .
 </head>
 <body>
 .
 .
 <s:datetimepicker name="dataInizioRicerca" label="data inizio ricerca (yyyy-MM-dd)" displayFormat="yyyy-MM-dd"/>
 .
.
</body>

      

What happened? Did I miss something?

0


source to share


4 answers


To use the datetimepicker, you need to use struts-dojo -tags, this appeared in the struts-dojo-plugin.jar of the struts library, now you have the tags loaded whit

 

and put inside the main tag



to render the date picker timer ...

... maybe this can help you ....

+1


source


Yes, you missed the Ajax title tag (Ajax struts tag).

Loads Dojo Javascript files at the top of the page.

Put the following in your head:



<head> [..other stuff] <s:head/> <!-- Struts 2 Ajax/Dojo needed for calendar --> </head>

By the way, the above posts are talking about struts 2.1.x and not struts 2.0.12 (the one you are using)

+1


source


I've known this for a while since this thread has been updated, but if anyone comes across the problem above and does a search, they might end up here and the following observations might be helpful.

I experienced similar issues when using Dojo with Struts 2.1, but this was due to major changes in how struts 2 works with Dojo. A useful resource when sorting out these issues can be found here: Toubleshootng Guide for Moving from Struts 2.0.x to Struts 2.1.x

If you were still having problems with Dojo, you could try using the jQuery Struts 2 plugin (do a search as I am not allowed to submit 2 hyperlinks)

0


source


You need to stop using dojo tags and use dojo yourself. struts - dojo is no longer supported.

0


source







All Articles