在表单中,有一个'名称'点击后打开地址簿名称的字段,通过该字段我可以选择用户列表。我想通过自定义控制做同样的事情,但没有得到如何实现它,因为没有选项' name'自定义控件中的字段。
答案 0 :(得分:2)
使用扩展程序库中的名称选择器 import requests
import xml.etree.ElementTree as ET
# this statement performs a GET on the specified url
response = requests.get('https://10.10.10.10:8443/cucm-uds/users?last=XXXXXX',verify=False, auth=('XXXXXX', 'XXXXXX'))
# print the json that is returned
print (response.text)
print('**********************')
#doc= print (response.text)
root = ET.fromstring(response.text)
for child in root:
doc=print(child.tag)
for user in root.findall('user'):
name=user.find('userName').text
print(name)
和数据提供程序" dominoNABNamePicker"。它是Notes 9的一部分。
这是一个如何使用它的简单示例:
Warning (from warnings module):
File "C:\Python34\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 821
InsecureRequestWarning)
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
Devices =
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<users uri="https://10.10.10.10:8443/cucm-uds/users" version="10.5.2" start="0" requestedCount="64" returnedCount="1" totalCount="1">
<user uri="https://10.10.10.10:8443/cucm-uds/user/taksh">
<id>d96a9ee4-1992-4a37-b6dd-6c0702792e08</id>
<userName>taksh</userName>
<firstName>taksh</firstName>
<lastName>XXXXXX</lastName>
<middleName></middleName>
<nickName></nickName>
<phoneNumber>11111</phoneNumber>
<homeNumber></homeNumber>
<mobileNumber>+1-111-111-1111</mobileNumber>
</user>
</users>
user
userName
taksh
您可以在Domino_Pickers.xsp的XPages Extension Library Demo数据库中找到更多示例,包括multiselection或typeahead。您可以在download package on OpenNTF中找到演示数据库。