/**判断包含元素的是否为空**/
(function () {
var rtn = "";
var doc = getCurrentDocument();
var childs2 = doc.getChilds("订单明细");
var count2 = childs2.size();
if (count2 <= 0) {
rtn = "订单明细必须填写";
}
return rtn;
})()
/**获取包含元素的数据**/
(function () {
var user_name = "";
var doc = getCurrentDocument();
var childs = doc.getChilds("kf_mobilemeter");
println("childs ===" + childs);
if (childs != null && childs.size() > 0) {
for (var it = childs.iterator(); it.hasNext(); ) {
var subdoc = it.next();
user_name = subdoc.getItemValueAsString("user_name");
}
}
return user_name;
})() |