--- Begin Message ---
Dear Gainty,

vielen Dank for your reply. I am very sorry but I cant supply you with a url. What I load into the div is the following:

<%@ include file="/common/taglibs.jsp"%>
<s:form id="traitForm"  method="post">
   <s:textfield id="form_start" theme="xhtml" cssClass="text medium" />
   <button id="button_start" type="button" class="button">..</button>
   <s:submit key="button.next" />
</s:form> <script type="text/javascript" src="<c:url value='/scripts/prototype.js'/>"></script> <script type="text/javascript" src="${ctx}/scripts/calendar/calendar.js"></script> <script type="text/javascript" src="${ctx}/scripts/calendar/calendar-setup.js"></script> <script type="text/javascript" src="${ctx}/scripts/calendar/lang/calendar-${pageContext.request.locale}.js"></script>
<script type="text/javascript">
   Form.focusFirstElement(document.forms["traitForm"]);
   Calendar.setup(
   {
       inputField      : "form_start",      // id of the input field
       //ifFormat        : "%m/%d/%Y",      // the date format
       ifFormat        : Calendar._TT['TT_DATE_TIME_FORMAT'],
       showsTime       : true,
       singleClick     : false,
       button          : "button_start"    // id of the button
   }
);
</script>

I use the following technique to load it into the div:

<s:form id="form_TraitPage" action="selectTraitPage"
       namespace="/" method="post" >
   <s:radio list="traits" listValue="getText(class.name)"
            listKey="class.name" name="traitType" />
   <s:submit id="submitSelectTratiPage" theme="ajax" targets="traitDiv" />
</s:form>
<s:div id="traitDiv" theme="ajax"
       cssStyle="width: 100%;"
       loadingText="getText('Loading')" >
</s:div>

The selectTraitPage-action returns the jsp with the jcalender. The problem is, that clicking the button than does not result in a calendar view. I can use it when loaded not in the div.

I simply dont know why and are very grateful for your help. I believe its a matter, that the imported calender.js and/or prototype.js (which is needed for the calendar) can bind to the button!? So it fails.....

Thx,
Henning


Martin Gainty schrieb:
can you supply the URL (which delivers the content..) and we can test it here
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<head>
  <sx:head debug="true" extraLocales="de-de"/>
</head>
<body>
<sx:div href="http://kropp.de/test";>Initial Content</sx:div>
</body>
</html>
Vielen Danke,
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Sat, 16 Aug 2008 22:41:09 +0200
> From: [EMAIL PROTECTED]
> To: user@struts.apache.org
> Subject: javascript in returned jsp through xhr
>
> Hi,
>
> I am a little stuck here. A action loads a jsp into a div. For this I
> use the ajax theme (dojo) and a form submit with target. Works fine. The
> Problem ist, that the jsp returned by the action has javascript in it.
> Its the jcalendar. Having this jsp load normally the calendar works
> fine, but not in div.
>
> To solve this I tried executeScripts option, but that did not work. I
> searched and found out that eval might help, but I simply dont know how
> this could help.
>
> Any hints would be greatly appreciated. Many thanks in advanced!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

------------------------------------------------------------------------
Talk to your Yahoo! Friends via Windows Live Messenger. Find Out How <http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008>




--- End Message ---
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to