在sharepoint发布页面2013中单击按钮后,人员选择器值消失 [英] People picker value disappears after button click in sharepoint publishing page 2013
问题描述
我已经为自定义功能开发了一个可视化Web部件,并尝试在sharepoint网站的Pages文件夹内添加页面.
I have developed a visual webpart for my custom functionality and tried to add in a page inside Pages folder of sharepoint site.
在我的Webpart中,添加了一个sharepoint人员选择器并添加了必填字段验证器.该验证器具有对人员选择器进行验证和验证的控件.
In my webpart have added one sharepoint people picker and added required field validator.That validator is having the control to validate and validation group to people picker.
如果我将Webpart添加到站点页面文件夹内的站点页面中,一切正常.
Everything works fine if i add the webpart in a site page inside site pages folder.
但是在发布页面中出现以下错误.因此,我填写了必填字段并保存.之后,当我在人员选择器中添加用户并单击下面的按钮时,该值在人员选择器中便消失了.
But am getting below error in a publishing page.So i have filled the mandatory field and saved.After that when i add user in people picker and click the button below the value gets disappeared in people picker.
如果有人遇到这种错误.请让我知道以解决此问题.我想要这个Web部件
If anyone facing this kind of error.please let me know to resolve this issue.I want to have this web part
仅在发布页面中.
Poovi
推荐答案
似乎这是单击按钮后重新加载页面引起的,建议您使用客户端代码来获取用户组. /span>
Seems this is caused by page reload after you click the button, I would suggest you use client side code to get user group.
您可以通过JavaScript从人员选择器控件中获取用户数据.
expand = groups> http://sp:12001/_api/web/getuserbyid(19)/?
expand=groups">http://sp:12001/_api/web/getuserbyid(19)/?
expand = groups
expand=groups
最好的问候,
李
这篇关于在sharepoint发布页面2013中单击按钮后,人员选择器值消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!