I am now adding a multiselect input box into the form. Once again, the IsDirty attribute is always showing as True. Any idea how I can add this control and its items to the form and keep the IsDirty as false.
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Example</title>
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim tmpMulti As MultiSelect = New MultiSelect
tmpMulti.ID = "MultiSelect1"
tmpMulti.FieldLabel = "MultiSelect1"
tmpMulti.MultiSelect = True
Dim li As Coolite.Ext.Web.ListItem
Dim sli As Coolite.Ext.Web.SelectedListItem
'we only need the value list, for multi-select lists the option text and values are always the same
Dim ValueList As String = "one,two,three,four"
Dim arrValueList As String() = ValueList.Split(",")
'the values could be comma separated
Dim arrValues As String() = "two,three".ToString.Split(",")
Dim ThisValue As String
Dim j As Integer
For j = 0 To arrValueList.GetUpperBound(0)
ThisValue = arrValueList(j)
'add this item to the list
li = New Coolite.Ext.Web.ListItem(ThisValue, ThisValue)
tmpMulti.Items.Add(li)
'add it as a selected item if necessary
If Array.IndexOf(arrValues, ThisValue) > -1 Then
sli = New Coolite.Ext.Web.SelectedListItem(ThisValue, ThisValue, j)
tmpMulti.SelectedItems.Add(sli)
End If
Next
Dim tmpAnchor As Anchor
tmpAnchor = New Anchor
tmpAnchor.Items.Add(tmpMulti)
FormLayoutCustomFieldLeft.Anchors.Add(tmpAnchor)
End Sub
</script>
<script type="text/javascript">
var saveForm = function() {
alert('IsDirty: ' + FormPanelCustomFieldLeft.isDirty());
// Coolite.AjaxMethods.Save();
};
</script>
</head>
<body>
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
<form id="form1" runat="server">
<ext:FormPanel ID="FormPanelCustomFieldLeft" runat="server" Header="false" Frame="false"
Border="false" Height="200" Width="200">
<Body>
<ext:FormLayout ID="FormLayoutCustomFieldLeft" runat="server" LabelAlign="Left" LabelWidth="75"
LabelSeparator=":">
<ext:Anchor Horizontal="100%">
<ext:Hidden runat="server" ID="HiddenCustomFieldIDs">
</ext:Hidden>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:Hidden runat="server" ID="HiddenCustomFieldNames">
</ext:Hidden>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:Hidden runat="server" ID="HiddenCustomFieldDataTypes">
</ext:Hidden>
</ext:Anchor>
<ext:Anchor Horizontal="100%">
<ext:Hidden runat="server" ID="HiddenCustomFieldInputTypes">
</ext:Hidden>
</ext:Anchor>
</ext:FormLayout>
</Body>
</ext:FormPanel>
<ext:Button ID="Button1" runat="server" Text="save">
<Listeners>
<Click Fn="saveForm" />
</Listeners>
</ext:Button>
</form>
</body>