如何从 Xpage 上自定义控件上的组中的自定义属性获取数据?
我正在开发一个具有自定义属性的自定义控件。
如果我想使用属性的值,这很容易。 对于属性“maptype”的值,我可以使用compositeData.maptype 但我该如何做这个机智群体呢?
例如,我有一个名为“Marker”的组,并且可以有多个组。 每个标记有五个属性:“地址”、“标题”、“图层”、“信息文本”和“图标”。 例如,如何访问第三个标记上的标题值?
I'm working on a custom control that has custom properties.
If I want to use the value of a property it is very easy.
For the value of the property "maptype" I can use compositeData.maptype
But how do I do this wit groups?
For example I have a goup called "Marker" and there can be multiple of them.
Each marker has five properties: "address", "title", "layer", "infotext" and "icon".
How do I access for example the value of title on the third marker?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这组属性被解释为 com.ibm.xsp.binding.PropertyMap java 类。多个实例被解释为 java.lang.ArrayList 类。知道这一点我会尝试
简单的数据绑定。或者
通过纯 javascript 进行访问。
the group of properties is interpreted as com.ibm.xsp.binding.PropertyMap java class. The multiple instances are interpreted as java.lang.ArrayList class. Knowing this I would try
for simple data binding. Or
for accessing via pure javascript.
有很多使用方法。它只是一个具有可以迭代的属性的集合。一种方法是在重复控件中使用它。这是一个如何使用它的示例:
There are many ways to use it. It is just a collection with properties that you can iterate. One way could be to use it inside a repeat control. This is an example how you could use it:
如果你想循环,你可以使用:
for(compositeDate.Marker 中的标记){
标记.标题;
}
If you want to loop, you can just use:
for(marker in compositeDate.Marker){
marker.title;
}