基于另一个列表项目填充列表项目(Populate a List Item based on another List Item)
我们有一个用户选择部门的UI。 它进入一个List项目。 我们为每个部门分别使用SharePoint用户组。
我想在列表项目之一中填充SharePoint组中的用户。 所以现在基于选择的部门,我需要填充列表项。
请帮助我这样做。 我可以使用以下方式获取组中的所有用户:
DropDownList ddl = new DropDownList(); ArrayList al = new ArrayList(); SPWeb web = SPContext.Current.Web; SPGroupCollection grpCln = web.Groups; foreach (SPGroup grp in grpCln) { if (grp.Name == "Viewers") { foreach (SPUser user in grp.Users) { al.Add(user.Name); } } } ddl.DataSource = al; ddl.DataBind();
We have an UI where user selects a department. It goes into a List item. We have separate SharePoint user groups for each department.
I want to populate the users in the SharePoint group in one of the list Item. So now based on department selected I need to populate the List Item.
Please help me in doing this. I am able to get all the users in a group using:
DropDownList ddl = new DropDownList(); ArrayList al = new ArrayList(); SPWeb web = SPContext.Current.Web; SPGroupCollection grpCln = web.Groups; foreach (SPGroup grp in grpCln) { if (grp.Name == "Viewers") { foreach (SPUser user in grp.Users) { al.Add(user.Name); } } } ddl.DataSource = al; ddl.DataBind();
原文:https://stackoverflow.com/questions/1867790
最满意答案
我检查了使用命令
rake middleware
中间件包含的rake middleware
,我发现OpenIdAuthentication::Middleware
已经包含在内。 通过rails-api自述文件,我将config.middleware.use Rack::MethodOverride
添加到config/environments/development.rb
。现在,要访问
open_id_authentication
gem方法,请将它包含在您使用的任何模块/控制器中,include OpenIdAuthentication::ControllerMethods
因为ControllerMethods
模块具有所使用的所有方法。I checked the middlewares included using command
rake middleware
and I found thatOpenIdAuthentication::Middleware
was already included. Going through rails-api README, I addedconfig.middleware.use Rack::MethodOverride
toconfig/environments/development.rb
.Now, to access
open_id_authentication
gem methods, include it in whichever module/controller you are using viainclude OpenIdAuthentication::ControllerMethods
asControllerMethods
module has all the methods being used.
相关问答
更多-
您需要在application_controller.rb中进行以下更改 更改 class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception end 至 class App ...
-
Android - 使用Oauth演示应用程序与Toodledo api集成(Android - integrate with Toodledo api - using Oauth demo app)[2023-12-05]
演示应用程序似乎不适用于新的身份验证oauth2 。 如何推进与Toodledo的Android集成: 我建议的方法是: 1 =很好地研究Playground API。 2 =查看PHP示例以获取详细信息。 最后我开始工作了。 我在这方面很新,所以我还没有发布我的解决方案。 我希望真正的专家用oauth2做一个非常简单的演示,就像在PHP中一样。 The Demo app seems not to work with the new authentication oauth2. How to move fo ... -
是否有一个策略可以作为未来API集成的占位符,如果以后需要它? 是的,有护照本地 。 当没有计划集成外部API时,是否有任何使用Passport for Node的观点? 恕我直言,如果你不需要它,请把它留下来。 YAGNI 。 较少的依赖是一件好事。 如果需要,可以添加简单。 我还认为社交登录在很大程度上是一种在某一时刻是伪需求的时尚,但现在很多人都超过了它。 Is there even a strategy that acts as a placeholder for future API integr ...
-
回答了我自己的问题,因为它需要一段时间来发现所有部分,并可能对其他人有用。 在沙箱上安装https://github.com/box/box-salesforce-sdk作为非托管包。 使用BoxPlatformApiConnection类进行身份验证,不要尝试在顶点中构建自己的令牌。 如果需要在C#生成的密钥(RSACryptoServiceProvider)和openssl .pem格式之间快速切换,请使用https://superdry.apphb.com/tools/online-rsa-key-c ...
-
好问题我也有同样的问题并解决了它 使用“ localhost ”作为重定向uri。 我希望能帮助你。 nice question i had also same issue and resolved it by use "localhost" as Redirection uri. i hope helps you.
-
控制器规范中的post方法为第一个参数获取操作名称,而不是路径,因此不是: post "/api/v1/users/#{@user.id}/events", #... 尝试: post :create, #... 控制器规格是单元测试。 如果您想测试整个堆栈,请使用功能规格而不是控制器规格。 The post method in a controller spec takes an action name for the first parameter, not a path, so instead o ...
-
我检查了使用命令rake middleware中间件包含的rake middleware ,我发现OpenIdAuthentication::Middleware已经包含在内。 通过rails-api自述文件,我将config.middleware.use Rack::MethodOverride添加到config/environments/development.rb 。 现在,要访问open_id_authentication gem方法,请将它包含在您使用的任何模块/控制器中, include Ope ...
-
使用Javascript API将Tableau集成到Shiny项目中(Integrate Tableau into Shiny project with Javascript API)[2022-02-11]
您的代码存在一些问题: 1-你必须使用tags$head(tags$script())告诉浏览器加载脚本而不是包含JS代码的includeScript 。 2- shinyjs扩展函数必须写成这样的shinyjs.init = function()并简化我内联它而不是将它放在一个单独的文件中 3-您的URL格式即格式必须为https://public.tableau.com/views/YOUR-VISUALIZATION 4-必须由服务器函数调用shinyjs.init函数,而不是ui shinyApp( ... -
你的问题似乎过于宽泛,但我试着给出一些答案。 如何将RESTful服务的结果传递给JSF组件? 您可以使用NetBeans的人员实现的模式。 如果使用此IDE,则可以选择从数据库自动构建RESTful Web服务。 本质上,此模式在名为AbstractFacade的抽象泛型类中创建所有DAO基本功能。 然后,对于JPA表示中存在的每个具体Entity类,它创建一个扩展AbstractFacade的Stateless类,并向其添加jax-rs注释,以便让它通过RESTful Web服务公开Entity类。 然 ...
-
Rails 4 Grape API ActionController :: RoutingError(Rails 4 Grape API ActionController::RoutingError)[2022-07-14]
通过指定cascade false您可以说Grape应该被允许处理HTTP错误而不受Rails的干扰。 因此,当请求API的挂载点下面的不匹配的URI时,不会生成ActionController::RoutingError (这可能由Rails完成),而是逐字地返回Grape默认的“不匹配的路由”处理程序的输出。 有点无益,这个处理程序生成一个简单的“Not Found”消息,即使指定了format :json ,这就是你所看到的行为。 解决方案是提供您自己的匹配器来捕获V1和V2模块中指定的路径以外的路由 ...