[
https://issues.apache.org/struts/browse/WW-1784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40675
]
Musachy Barroso commented on WW-1784:
-------------------------------------
Then you would be right, dojo.require("dojo.widget.DatePicker") is missing. The
problem is that dojo widgets are loaded from returned html (even if XHR is
used), but the dojo.rquire() calls are stripped from the html, I don't know
what is the reason, but look at Dojo comments on their code(the one that loads
the widgets):
// strip out all djConfig variables from script tags nodeValue
// this is ABSOLUTLY needed as reinitialize djConfig after dojo is initialised
// makes a dissaster greater than Titanic, update remove writeIncludes() to
var sc = match[2].replace(/(?:var
)?\bdjConfig\b(?:[\s]*=[\s]*\{[^}]+\}|\.[\w]*[\s]*=[\s]*[^;\n]*)?;?|dojo\.hostenv\.writeIncludes\(\s*\);?/g,
"");
if(!sc){ continue; }
// cut out all dojo.require (...) calls, if we have execute
// scripts false widgets dont get there require calls
// does suck out possible widgetpackage registration as well
There isn't much we can do about it, as a workaround, you can use the head tag
on the container page, so the dojo.require calls are in place.
> DateTimePicker does not work from JSP action result
> ---------------------------------------------------
>
> Key: WW-1784
> URL: https://issues.apache.org/struts/browse/WW-1784
> Project: Struts 2
> Issue Type: Bug
> Components: Component Management
> Affects Versions: 2.0.6
> Environment: Java 1.5 Apache Tomcat 5.5 Struts 2 2.0.6
> Reporter: Chris Kulseth
> Assigned To: Musachy Barroso
> Fix For: 2.1.0
>
>
> DateTimePicker works in main.jsp page with a HEAD tag but will not show in a
> DIV created from a JSP action result.
> ****** this tag called test works and is part of the original html page
> with a HEAD section
>
> <td class="tdLabel"><label for="test" class="label">Date:</label></td>
> <td><script type="text/javascript">
> dojo.require("dojo.widget.DatePicker");
> </script>
> <span id="test" style="white-space: nowrap;"><input name="dojo.test"
> value="2007-03-01" dojoattachpoint="valueNode" type="hidden"><input
> name="test" value="" style="vertical-align: middle; width: 7em;"
> dojoattachpoint="inputNode" autocomplete="off" type="text"> <img
> src="/rcm/struts/dojo/src/widget/templates/images/dateIcon.gif" alt="Select a
> date" dojoattachevent="onclick: onIconClick" dojoattachpoint="buttonNode"
> style="vertical-align: middle; cursor: pointer;"><div
> dojoattachpoint="containerNode" style="display: none; position: absolute;
> z-index: 10;" class="dojoPopupContainer"><div style=""
> class="datePickerContainer" dojoattachpoint="datePickerContainerNode">
> <table class="calendarContainer" cellpadding="0" cellspacing="0">
> <thead>
> **** this was generated from the jsp result action and does not show up
> <div class="cssScrollContent">
> <form id="logCreateShow" name="logCreateShow" onsubmit="return false; return
> true;" action="/rcm/logCreateShow.action" method="post" class="cssMain">
> <table class="cssMain">
> <input name="logname" value="System Log" id="logCreateShow_logname"
> type="hidden">
> <tbody><tr>
> <td class="tdLabel"><label for="createdDT" class="label">Date<span
> class="required">*</span>:</label></td>
> <td>
> <div dojotype="dropdowndatepicker" id="createdDT" value="2007-03-01T18:37:12"
> name="dojo.createdDT" inputname="createdDT" saveformat="rfc"
> onfocus="this.className='cssInput1';"
> onblur="this.className='cssInput0';"></div>
> </td>
> </tr>
> <tr>
> <td class="tdLabel"><label for="logCreateShow_entityName"
> class="label">ID<span class="required">*</span>:</label></td>
> <td><input name="entityName" size="26" maxlength="25" value=""
> id="logCreateShow_entityName" class="cssInput0"
> onfocus="this.className='cssInput1';" onblur="this.className='cssInput0';"
> type="text">
> </td>
> </tr>
> </div></td>
> </tr>
> </tbody></table></form>
> </div>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.