1
我正在尝试使用Spring Webflow创建我的第一个ajax调用/响应,并使用thymeleaf呈现响应。我已经使用thymeleaf例如,从他们的PDF Thymeleaf +弹簧3Thymeleaf Spring weblow ajax
流动配置:
<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执行,然后我看到:
铬的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
我不知道怎么样继续或从哪里开始搜索问题。任何人有想法?
谢谢,有一些javascript改变一切形式的ID来formSomeNumebr。现在还有其他问题,但是会重复其他的计算器问题。 – timoras