Spring webflow で最初の ajax 呼び出し/応答を作成し、応答を thymeleaf でレンダリングしようとしています。pdf Thymeleaf + Spring 3 の thymeleaf の例を使用しました。
フロー構成:
<view-state id="detail" view="bookingDetail">
<transitionon="updateData">
<render fragments="hoteldata"/>
</transition>
</view-state>
私のhtml:
<div id="data" th:fragment="hoteldata">
This is a content to be changed
</div>
と
<script type="text/javascript" th:src="@{/resources/dojo/dojo.js}"></script>
<script type="text/javascript" th:src="@{/resources/spring/Spring.js}"></script>
<script type="text/javascript" th:src="@{/resources/spring/Spring-Dojo.js}"></script>
...
<form id="triggerform" method="post" action="">
<input type="submit" id="doUpdate" name="_eventId_updateData" value="Update now!" />
</form>
<script type="text/javascript">
Spring.addDecoration(
new Spring.AjaxEventDecoration({formId:'triggerform',elementId:'doUpdate',event:'onclick'}));
</script>
まず、次のように送信を無効にします。
<input type="submit" id="doUpdate" name="_eventId_activeOrders" value="Update now!" onclick="return false;"/>
ページ全体のリロードを防ぎます。
ログで、SpringWebflow によってアクションが実行されていることがわかり、次のように表示されます。
Chrome Js コンソール:
Uncaught TypeError: Cannot read property 'method' of null Spring-Dojo.js:16
dojo.declare.submitForm Spring-Dojo.js:16
dojo.declare.submit Spring-Dojo.js:16
dojo.hitch
または Firefox コンソール:
TypeError: _1a is null
http://localhost:9092/resources/spring/Spring-Dojo.js
Line 16
どのように進めればよいのか、検索の問題をどこから始めればよいのかわかりません。誰にもアイデアがありますか?