コード例 #1
0
        public override IList <InputField> GetInputFields()
        {
            var list = new List <InputField>();

            list.Add(new StringInput("Name", "Name", DataItem?.Name, mandatory: true));
            list.Add(new StringInput("Description", "Description", DataItem?.Description, mandatory: true));

            var existingItems = UserRoleService.RetrieveEventRoleAssociationsForUserRole(DataItem?.Id);
            var listSelection = new ListSelectionInput("Events", "Allowed Events", existingItems)
            {
                AvailableItemsLabel = "List of Events:",
                SelectedItemsLabel  = "Chosen Events:",
                ListSource          = UserRoleService.GetListOfEvents()
            };

            list.Add(listSelection);

            list.Add(new HiddenInput("Id", DataItem?.Id));

            return(list);
        }