Beispiel #1
0
        protected override void FillOutParameters(Node pars, BaseControl ctrl)
        {
            base.FillOutParameters(pars, ctrl);
            BaseWebControlListFormElement ret = ctrl as BaseWebControlListFormElement;
            Node ip   = Ip(pars);
            Node node = ip["_code"].Get <Node>();

            if (node.Contains("items"))
            {
                foreach (Node idxItemNode in node["items"])
                {
                    if (idxItemNode.Name == null)
                    {
                        throw new ArgumentException("list item for select needs unique name of node to be used as value");
                    }
                    if (idxItemNode.Value == null)
                    {
                        throw new ArgumentException("list item for select needs value of node to be used as text to show user in item");
                    }
                    ListItem item = new ListItem(idxItemNode.Get <string>(), idxItemNode.Name);
                    if (!idxItemNode.GetValue("enabled", true))
                    {
                        item.Enabled = false;
                    }
                    ret.Items.Add(item);
                }
            }
        }
Beispiel #2
0
 public ListItemCollection(BaseWebControlListFormElement control)
 {
     _control = control;
 }