I am using Struts 2.3 with struts2-jQuery-plugin.
I have to load dynamically with ajax a result from an action.
In the JSP there is some normal html and a jQuery tag
<sj:datepicker cssClass="dataScadenzaDiv" id="dataScadenzaDiv"
name="dataScadenza" maxDate="-1d" label="data scadenza" theme="xhtml"/>
All works OK and the code injected with ajax is:
<!-- lotto dpi -->
<tr>
<td class="tdLabel"><label for="lotto" class="label">Lotto:</label></td>
<td><input type="text" name="txtLotto" size="15" value="" id="lotto"/></td>
</tr>
<!-- tGestDataScadenza -->
<div id="dataScadenzaAjax"></div>
<input type="text" name="dataScadenza" value="" id="dataScadenzaDiv" class="dataScadenzaDiv" theme="xhtml"/><script type='text/javascript'>
jQuery(document).ready(function () {
jQuery.struts2_jquery_ui.initDatepicker(false);
});
jQuery(document).ready(function () {
var options_dataScadenzaDiv = {};
options_dataScadenzaDiv.showOn = "both";
options_dataScadenzaDiv.buttonImage = "/RadioFrequenza2/struts /js/calendar.gif";
options_dataScadenzaDiv.maxDate = "-1d";
options_dataScadenzaDiv.jqueryaction = "datepicker";
options_dataScadenzaDiv.id = "dataScadenzaDiv";
options_dataScadenzaDiv.name = "dataScadenza"; jQuery.struts2_jquery_ui.bind(jQuery('#dataScadenzaDiv'),options_dataScadenzaDiv );
});
</script>
but now <input type="text" name="dataScadenza">
is rendered as a normal text
and dot as a datepicker.
I think that the injected javascript is not executed...
What can I do?