我正在创建一个包含2个文本字段的多字段组件.以下是我的对话框xml.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
title="dialog"
xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
<links
jcr:primaryType="cq:Widget"
fieldLabel="QuickLinks"
name="./links"
xtype="multifield">
<fieldConfig
jcr:primaryType="cq:Widget"
xtype="multifield">
<items jcr:primaryType="cq:WidgetCollection">
<title
jcr:primaryType="cq:Widget"
fieldLabel="Title"
hideLabel="{Boolean}false"
name="./jcr:title"
xtype="textfield"/>
<url
jcr:primaryType="cq:Widget"
fieldLabel="URL"
name="./jcr:url"
xtype="textfield"/>
</items>
</fieldConfig>
</links>
</items>
</jcr:root>
Run Code Online (Sandbox Code Playgroud)
我能够编辑内容,并保存内容.但是我有两个问题 - 1)当对话框加载时,它总是空的,当我重新打开对话框时它不显示保存的内容2)向上和向下箭头不再工作.任何解决这些问题的建议都非常感谢.非常感谢你.
为什么我收到“int 类型参数不可迭代错误”?这是我的简单代码。
def remove_duplicates(x):
out = x[0]
for i in range(1,len(x)):
if x[i] in out:
print "duplicate " + str(x[i])
else:
out.append(x[i])
return out
remove_duplicates([4,5,5,4])
Run Code Online (Sandbox Code Playgroud)
得到以下输出。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in remove_duplicates
TypeError: argument of type 'int' is not iterable
Run Code Online (Sandbox Code Playgroud) 我有以下javascript使用googlemap在Web应用程序中围绕标记绘制一个圆圈.位置详细信息来自数据库,对于每个位置,我创建一个标记,其周围有一个固定的半径圆圈.出于某种原因,圆圈没有出现.有什么建议吗?
var marker, i, center;
for (i = 0; i < locations.length; i++) {
center = new google.maps.LatLng(locations[i][1], locations[i][2]);
marker = new google.maps.Marker({
position: center,
map: map
});
var circle = new google.maps.Circle({
center: center,
map:map,
radus:160930,
strokeColor: "red",
strokeOpacity:0.8,
strokeWeight: 2,
fillColor: "red"
});
circle.bindTo('center',marker,'position');
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
};
})(marker, i));
}
Run Code Online (Sandbox Code Playgroud) javascript google-maps google-maps-api-3 google-maps-markers