Add prevalue in checkbox list from another data source ?
Hi all,
I'm quite new to Umbraco. I dont know how to explain clearly the problem I face, but I will use images to demonstrate it.
For example, I have a content named Company Management which has a company list property. This list is created based on nested content type, so the list is able to add or remove items. (I'm considering using Archetype instead)
Now all I want to do is put all the items in this list into prevalue of a permission checkbox property in another content page. It 'll be something like this.
So, whenever I update the list on Company Management page, the list items in permission check box also updated.
Thus, can you give me some advices or approaches for this situation. I searched a lot but nothing good comes up. Maybe I used wrong keywords.
using System.Collections.Generic;
using System.Linq;
using nuPickers.Shared.DotNetDataSource;
public class CompaniesDotNetDataSource : IDotNetDataSource
{
IEnumerable<KeyValuePair<string, string>> IDotNetDataSource.GetEditorDataItems(int contextId)
{
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
var companyManagement = umbracoHelper.TypedContentSingleAtXPath("//companyManagementDocTypeAlias[@isDoc]");
// if using models builder this should be IEnumerable<IPublishedContent>
var companies = companyManagement.CompanyList;
return companies.ToDictionary(x => x.Id.ToString(), x => x.Name);
}
}
How are you setting this up? Where are you placing your CompaniesDotNetDataSource.cs ? What are you refering to as Assembley in nupicker setup? I'm runing Umbraco 7.15.3, nuPickers 1.7.1 and donĀ“t have a App_Code folder.
Add prevalue in checkbox list from another data source ?
Hi all,
I'm quite new to Umbraco. I dont know how to explain clearly the problem I face, but I will use images to demonstrate it.
For example, I have a content named Company Management which has a company list property. This list is created based on nested content type, so the list is able to add or remove items. (I'm considering using Archetype instead)
Now all I want to do is put all the items in this list into prevalue of a permission checkbox property in another content page. It 'll be something like this.
So, whenever I update the list on Company Management page, the list items in permission check box also updated.
Thus, can you give me some advices or approaches for this situation. I searched a lot but nothing good comes up. Maybe I used wrong keywords.
I think this is the quite normal problem, hope someone can see and help me. Thank all !
Hi there, it sounds like the DotNet CheckBox Picker in nuPickers package could help out here.
HTH, Hendy
Thank you so much Hendy Racheradmin,
I know what to do next. Thank you again !
Hi Hendy.
How are you setting this up? Where are you placing your CompaniesDotNetDataSource.cs ? What are you refering to as Assembley in nupicker setup? I'm runing Umbraco 7.15.3, nuPickers 1.7.1 and donĀ“t have a App_Code folder.
/Oliver
is working on a reply...