Castle.MonoRail.Framework.Helpers.FormHelper.CheckboxItem C# (CSharp) Method

CheckboxItem() private method

Outputs a checkbox element (for internal use)
private CheckboxItem ( int index, string target, string suffix, Castle.MonoRail.Framework.Helpers.SetItem item, IDictionary attributes ) : string
index int
target string The object to get the value from and to be based on to create the element name.
suffix string
item Castle.MonoRail.Framework.Helpers.SetItem
attributes IDictionary Attributes for the FormHelper method and for the html element it generates
return string
		internal string CheckboxItem(int index, string target, string suffix, SetItem item, IDictionary attributes)
		{
			if (item.IsSelected)
			{
				AddChecked(attributes);
			}
			else
			{
				RemoveChecked(attributes);
			}

			target = String.Format("{0}[{1}]", target, index);
			
			string elementId = CreateHtmlId(attributes, target, true);
			
			string computedTarget = target;
			
			if (suffix != null && suffix != String.Empty)
			{
				computedTarget += "." + suffix;
			}

			return CreateInputElement("checkbox", elementId, computedTarget, item.Value, attributes);
		}