我想知道在升級open laszlo時遇到類似缺陷的人。將OpenLaszlo應用程序遷移到5.0:標記xxx不能用作子視圖
The tag xxx cannot be used as a child of view
The tag xxx cannot be used as a child of class
爲什麼會發生此錯誤?任何想法?
我想知道在升級open laszlo時遇到類似缺陷的人。將OpenLaszlo應用程序遷移到5.0:標記xxx不能用作子視圖
The tag xxx cannot be used as a child of view
The tag xxx cannot be used as a child of class
爲什麼會發生此錯誤?任何想法?
錯誤消息xxx不能用作孩子yyy的視圖僅僅意味着您在標籤內使用標籤,並且子標籤未知。簡單的例子:
<canvas debug="true">
<view width="100" height="100" bgcolor="red">
<unknown_tag />
</view>
</canvas>
編譯錯誤消息: class_tag_error.lzx:4:48:標記 'unknown_tag' 不能被用作視圖 class_tag_error.lzx的子:5:20:未知標籤
我記得有些人在從4.0升級到4.2時有類似的問題,這裏是discussion in the laszlo-dev mailing list。問題是由代碼中的標準OpenLaszlo標記引起的問題,還是由您添加的自定義類或標記造成的?
沒有爲所有類模式文件和標籤的OpenLaszlo編譯器知道,它可以在
找到$ LPS_HOME/WEB-INF/LPS /模式/編譯/ lfc.xml
如果編譯器抱怨內置的LZX標籤,您可以 - 作爲最後的手段 - 檢查該文件,如果該特定標籤的類定義仍然存在於您正在使用的OpenLaszlo版本中。這裏是 - 例如 - 爲<視圖>標記的類/接口定義的開始:
<interface extends="node" jsname="LzView" name="view">
<method args="who, self, prop, refView" name="$lzc$getAttributeRelative_dependencies"/>
<method args="who, self" name="$lzc$getBounds_dependencies"/>
<method args="who, self" name="$lzc$getCurrentTime_dependencies"/>
<method args="ignore" name="$lzc$getMouse_dependencies"/>
<method args="who, self" name="$lzc$getTotalTime_dependencies"/>
<method args="ignore" name="$lzc$isMouseOver_dependencies"/>
... (continued)
雖然這絕對不是發現如果一個標籤仍然存在的一個舒適的方式。
由於我添加了很少的自定義標籤,問題就在發生。 – karthick 2012-08-13 05:33:12
哪個標籤導致問題?你使用二進制庫嗎?在OpenLaszlo維基中提到了與二進制庫有關的錯誤消息:http://wiki.openlaszlo.org/Binary_Libraries#Restrictions – 2012-08-10 19:34:35