我将我的应用程序从Tapestry 5.0.18升级到5.1.0.5,我得到以下javascript错误。我知道在5.1.0.5中有部分ajax响应的WaitForPage()修复。但我仍然坚持java脚本错误。以下是我的代码。
<table t:id="itemPanel" t:type="CustomSlidingPanel" closed="true" subject="literal:itemes" blockId="literal:itemPanel_content" linkToDisplay="New item" actionLink="newitem" zoneOnAction="itemZone"/>
<div id="itemPanel_content" style="display: none;">
<table t:id="itemGrid" t:type="customGrid" source="item" row="itemRow" clientId="literal:itemGrid" rowId="itemRow.itemId" add="edit" include="type, item, price,store,startDate, endDate, ynprimary" inplace="true">
<t:parameter name="editCell">
<t:actionlink t:id="editItem" t:zone="itemZone" t:context="itemRow.id">Edit</t:actionlink>
</t:parameter>
</table>
</div>
<t:zone t:id="itemZone" visible="false">
<t:delegate to="itemBlock" />
</t:zone>
<t:block t:id="itemBlock">
<div id="newitemDiv" class="dataEntry"/>
<div id="itemDivParent">
<div id="itemDiv" class="dataEntry">
<t:form t:id="itemForm" name="itemForm">
<t:if test="itemObject.id">
<script type="text/javascript">insertDivElement('itemGrid${itemObject.id}','itemDivParent','itemDiv','newitemDiv','8');</script>
</t:if>
<t:if test="newitem">
<script type="text/javascript">createNewDivElement('itemDivParent','itemDiv','newitemDiv');</script>
</t:if>
<table t:id="itemComponent" t:type="item" itemObject="itemObject"/>
<div style="width: 50%" align="center">
<input t:id="saveitem" t:type="Submit" class="button" value="Save" /> <input type="button" class="button" value="Cancel" onClick="hideDivs('itemDivParent','itemDiv','newitemDiv');" /> <t:if test="itemImported" negate="true">
<input t:id="deleteitem" t:type="SubmitContext" class="button" value="Delete" t:context="itemObject.id" /> </t:if>
</div>
<br />
</t:form>
</div>
</div>
</t:block>
以下是我收到的错误消息。看起来像Tapestry.js中的“Tapestry.waitForPage(event)”有问题。有人可以帮忙吗?
Message: Object doesn't support this property or method
Line: 197
Char: 1
Code: 0
URI: http://localhost:8080/ItemEntry?itemId=131686
<a id="editItemPrice" onclick="javascript:Tapestry.waitForPage(event);" href="itementry.edititemprice/6578">Edit</a>
答案 0 :(得分:0)
我认为这可能与combine scripts setting discussed on the mailing list有关。将-Dtapestry.combine-scripts = false设置为VM参数或将其添加到AppModule:
public static void contributeApplicationDefaults(final MappedConfiguration<String, String> configuration) {
configuration.add(SymbolConstants.COMBINE_SCRIPTS, "false");
}
你有理由不升级到5.3吗?它比5.1有很多改进。