如何从 Xpage 上自定义控件上的组中的自定义属性获取数据?

发布于 2025-01-06 06:07:53 字数 206 浏览 3 评论 0原文

我正在开发一个具有自定义属性的自定义控件。

如果我想使用属性的值,这很容易。 对于属性“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ζ澈沫 2025-01-13 06:07:53

这组属性被解释为 com.ibm.xsp.binding.PropertyMap java 类。多个实例被解释为 java.lang.ArrayList 类。知道这一点我会尝试

compositeData.Marker[2].address

简单的数据绑定。或者

compositeData.Marker.get(2).get('address')

通过纯 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

compositeData.Marker[2].address

for simple data binding. Or

compositeData.Marker.get(2).get('address')

for accessing via pure javascript.

鱼忆七猫命九 2025-01-13 06:07:53

有很多使用方法。它只是一个具有可以迭代的属性的集合。一种方法是在重复控件中使用它。这是一个如何使用它的示例:

            <xp:repeat id="repeat1" rows="30"
                value="#{javascript:compositeData.Marker}"
                var="rowMarker">

                <xp:label id="lbladdress"
                    value="#javascript:rowMarker.address}">
                </xp:label>
                <xp:label id="lbltitle"
                    value="#javascript:rowMarker.title}">
                </xp:label>

            </xp:repeat>

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:

            <xp:repeat id="repeat1" rows="30"
                value="#{javascript:compositeData.Marker}"
                var="rowMarker">

                <xp:label id="lbladdress"
                    value="#javascript:rowMarker.address}">
                </xp:label>
                <xp:label id="lbltitle"
                    value="#javascript:rowMarker.title}">
                </xp:label>

            </xp:repeat>
甜点 2025-01-13 06:07:53

如果你想循环,你可以使用:
for(compositeDate.Marker 中的标记){
标记.标题;
}

If you want to loop, you can just use:
for(marker in compositeDate.Marker){
marker.title;
}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文