<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ExpressionTemplateView.ascx.cs"
    Inherits="Zap.BI.Portal.Controls.UserControls.ResourceControls.ExpressionTemplateView" %>
<%@ Register TagPrefix="zap" TagName="ColorButton" Src="~/Controls/UserControls/ColorPicker/ColorButton.ascx" %>

<%--Area in which changes to inputs should register unsaved changes client side--%>
<div runat="server" ID="ExpressionTemplateEditor">
    <div class="unsavedChangesInputs">
        <%--Expressions Area--%>
        <div class="showHideExpressions">
            <asp:Label runat="server" CssClass="ui-subtitle" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Expressions %>" />
            <img id="HideExpressions" runat="server" class="hideExpressionsButton showHideButton" />
            <img id="ShowExpressions" runat="server" class="showExpressionsButton showHideButton" style="display: none;" />
        </div>
        <input type="hidden" runat="server" class="ExpressionsVisible" value="true" />
        <div class="ExpressionsArea" style="padding-left: 5px;">
            <table cellpadding="0" cellspacing="0">
                <colgroup>
                    <col width="181px" />
                    <col />
                </colgroup>
                <tr class="withStatementArea" style="display: none;">
                    <td valign="top">
                        <asp:Label ID="WithExpressionLabel" runat="server" CssClass="ui-form-label-inline" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_WithExpression %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_WithExpression %>" />
                    </td>
                    <td>
                        <asp:TextBox ID="WithExpression" CssClass="withTextBox ui-input-box ui-code" TextMode="MultiLine" runat="server" Rows="7" Width="600px" />
                    </td>
                </tr>
                <tr style="padding-top: 10px;">
                    <td valign="top">
                        <table style="width: 100%;">
                            <tr>
                                <td valign="top">
                                    <asp:DropDownList ID="Type" runat="server" AutoPostBack="true" OnSelectedIndexChanged="Type_SelectionChanged" CssClass="ui-input-box" Style="margin-left: 0px;"
                                        ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_Type %>" />
                                </td> 
                                <td align="right">
                                    <asp:Image ID="SelectImage" runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_SelectExpression %>" Style="width: 16px; height: 16px;" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" class="ui-checkbox ui-checkbox-label">
                                    <input type="checkbox" id="WithRequired" class="showWithCheckBox" runat="server" />
                                    <asp:Label runat="server" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_WithRequired %>" />
                                </td>
                            </tr>                            
                        </table>
                    </td>
                    <td>
                        <asp:TextBox ID="SelectExpression" CssClass="selectTextBox ui-input-box ui-code" TextMode="MultiLine" runat="server" Rows="7" Width="600px" />
                    </td>
                </tr>             
            </table>
        </div>
        <%--Advanced Options Area--%>
        <div class="showHideAdvancedOptions" style="cursor: pointer; padding: 5px 0 5px 0;">
            <asp:Label runat="server" CssClass="ui-subtitle" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_AdvancedOptions %>" />
            <img id="AdvancedHide" runat="server" class="hideAdvancedButton showHideButton" style="display: none;" />
            <img id="AdvancedShow" runat="server" class="showAdvancedButton showHideButton" />
        </div>
        <input id="AdvancedOptionsVisible" runat="server" type="hidden" class="AdvancedOptionsVisible" value="false" />
        <div id="AdvancedOptionsArea" class="advancedOptionsArea" style="padding-left: 5px; display: none;">
            <table cellpadding="5" style="width: 788px;">
                <colgroup>
                    <col width="172px" />
                    <col />
                    <col width="260px" />
                </colgroup>
                <tr>
                    <td>
                        <asp:Label ID="AbbreviatedNameLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_AbbreviatedName %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_AbbreviatedName %>" />
                    </td>
                    <td>
                        <asp:TextBox ID="AbbreviatedName" CssClass="ui-input-box ui-fixed-width" Columns="25" runat="server" />
                    </td>
                    <td rowspan="3" valign="top" style="padding-left: 50px;">
                        <table cellpadding="5">
                            <tr>
                                <td>
                                    <asp:CheckBox ID="SelectionType" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_SelectionType %>"
                                        runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_SelectionType %>" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="ReferenceTemplate" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ReferenceTemplate %>"
                                        runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_ReferenceTemplate %>" AutoPostBack="true" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="SummaryOverLeaves" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_SummaryOverLeaves %>"
                                        runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_SummaryOverLeaves %>" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="DefaultFieldLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_DefaultField %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_DefaultField %>" />
                    </td>
                    <td>
                        <%-- Necessary as adding and removing fields requires updating this drop down --%>
                        <zapWeb:ZapUpdatePanel ID="DefaultFieldPanel" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DefaultField" CssClass="ui-input-box ui-fixed-width" runat="server" />
                            </ContentTemplate>
                        </zapWeb:ZapUpdatePanel>
                    </td>
                </tr>
                <tr id="DimensionFieldArea" runat="server">
                    <td>
                        <asp:Label ID="DimensionFieldLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_DimensionField %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_DimensionField %>" />
                    </td>
                    <td>
                        <zapWeb:ZapUpdatePanel ID="DimensionFieldPanel" UpdateMode="Conditional" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DimensionField" CssClass="ui-input-box ui-fixed-width" runat="server" />
                            </ContentTemplate>
                        </zapWeb:ZapUpdatePanel>
                    </td>
                </tr>
                <tr id="CalculationOrderArea" runat="server">
                    <td>
                        <asp:Label ID="CalculationOrderLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_CalculationOrder %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_CalculationOrder %>" runat="server" />
                    </td>
                    <td id="CalculationOrderWrapper" runat="server">
                        <zapWeb:JavaScriptBootstrap runat="server" ID="calculationOrderBootstrap" />
                        <asp:HiddenField runat="server" ID="CalculationOrderHiddenField" />
                    </td>
                </tr>
                <tr id="FormatStringArea" runat="server">
                    <td>
                        <asp:Label ID="FormatStringLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_FormatString %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_FormatString %>" runat="server" />
                    </td>
                    <td>
                        <asp:TextBox ID="FormatString" CssClass="ui-input-box ui-fixed-width" Columns="25" runat="server" />
                    </td>
                </tr>
                <tr id="FormatFieldArea" runat="server">
                    <td>
                        <asp:Label ID="FormatFieldLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_FormatField %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_FormatField %>" runat="server" />
                    </td>
                    <td>
                        <asp:DropDownList ID="FormatField" CssClass="ui-input-box ui-fixed-width" runat="server" />
                    </td>
                </tr>
                <tr id="ReferenceTemplateToggleTypeArea" runat="server">
                    <td>
                        <asp:Label ID="ReferenceTemplateToggleTypeLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ReferenceTemplateToggleType %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_ReferenceTemplateToggleType %>" runat="server" />
                    </td>
                    <td>
                        <asp:DropDownList ID="ReferenceTemplateToggleType" CssClass="ui-input-box ui-fixed-width" runat="server" AutoPostBack="true" />
                    </td>
                </tr>
                <tr id="ReferenceTemplateToggleGroupIdArea" runat="server">
                    <td>
                        <asp:Label ID="ReferenceTemplateToggleGroupIdLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ReferenceTemplateToggleGroupId %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_ReferenceTemplateToggleGroupId %>" runat="server" />
                    </td>
                    <td>
                        <asp:TextBox ID="ReferenceTemplateToggleGroupId" CssClass="ui-input-box ui-fixed-width" Columns="25" runat="server" />
                    </td>
                </tr>
                <tr id="ReferenceOrderArea" runat="server">
                    <td>
                        <asp:Label ID="ReferenceOrderLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ReferenceOrder %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_ReferenceOrder %>" runat="server" />
                    </td>
                    <td colspan="2">
                        <asp:TextBox ID="ReferenceOrder" CssClass="ui-input-box ui-fixed-width" Columns="12" runat="server" />
                        <asp:RangeValidator ID="ReferenceOrderValidator" ControlToValidate="ReferenceOrder" runat="server"
                            CssClass="ui-form-label" ForeColor="Red" Type="Integer" SetFocusOnError="true" MinimumValue="-2147483648" MaximumValue="2147483647"
                            ErrorMessage="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Message_InvalidIntInput %>" />
                    </td>
                </tr>
                <tr id="IsHtmlArea" runat="server">
                    <td>
                        <asp:Label ID="IsHtmlLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_IsHtml %>"
                            ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_IsHtml %>" runat="server" />
                    </td>
                    <td colspan="2">
                        <asp:CheckBox runat="server" ID="IsHtml" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <%--Fields Area--%>
    <div class="showHideFields">
        <asp:Label runat="server" CssClass="ui-subtitle" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Fields %>" />
        <img id="FieldsHide" runat="server" class="hideFieldsButton showHideButton" />
        <img id="FieldsShow" runat="server" class="showFieldsButton showHideButton" style="display: none;" />
    </div>
    <input type="hidden" runat="server" class="FieldsVisible" value="true" />
    <div class="FieldsArea">
        <div style="padding-top: 20px; padding-bottom: 10px;">
            <zapWeb:ZapUpdatePanel ID="TemplateFieldGridViewPanel" UpdateMode="Conditional" runat="server">
                <ContentTemplate>
                    <dxwgv:ASPxGridView runat="server" ID="TemplateFieldGridView" EnableCallBacks="false" Width="796px" KeyFieldName="FieldKey" AutoGenerateColumns="False" OnSelectionChanged="TemplateFieldGridView_SelectionChanged"
                        Styles-Header-CssClass="grid-header-cell"
                        Styles-Row-CssClass="grid-row"
                        Styles-EmptyDataRow-CssClass="grid-empty"
                        Styles-Disabled-CssClass="is-disabled"
                        Styles-SelectedRow-CssClass="is-selected"
                        Styles-FocusedRow-CssClass="has-focus"
                        Styles-PagerBottomPanel-CssClass="grid-pager">
                        <Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="100" />
                        <SettingsBehavior ProcessSelectionChangedOnServer="true" AllowMultiSelection="true" />
                        <SettingsPager PageSize="20" />
                        <Columns>
                            <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" Caption="&nbsp;" VisibleIndex="0" Width="30" CellStyle-CssClass="checkbox-column" />
                            <dxwgv:GridViewDataColumn FieldName="FieldKey" VisibleIndex="1" SortOrder="Ascending" Caption="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Key %>" />
                            <dxwgv:GridViewDataColumn FieldName="FieldName" VisibleIndex="2" Visible="true" Caption="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Name %>" />
                            <dxwgv:GridViewDataColumn FieldName="FieldType" VisibleIndex="3" Visible="true" Caption="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_FieldType %>" />
                            <dxwgv:GridViewDataColumn FieldName="FieldDescription" VisibleIndex="4" Width="240" Visible="true" Caption="<%$ Resources: Controls.ControlText, Label_Description %>" />
                        </Columns>
                        <Styles CssPostfix="DE">
                            <AlternatingRow Enabled="True" />
                        </Styles>
                    </dxwgv:ASPxGridView>
                </ContentTemplate>
            </zapWeb:ZapUpdatePanel>
        </div>
        <zapWeb:ZapUpdatePanel ID="FieldButtonsPanel" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <asp:Button ID="AddField" runat="server" CssClass="button" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Add %>" />
                <asp:Button ID="deleteField" Enabled="false" CssClass="button" runat="server" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_DeleteField %>" />
            </ContentTemplate>
        </zapWeb:ZapUpdatePanel>
        <zapWeb:ZapUpdatePanel ID="expressionTemplateFieldPanel" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <div id="FieldArea" style="display: none;" runat="server">
                    <table cellpadding="5" style="width: 788px;">
                        <colgroup>
                            <col width="172px" />
                            <col />
                            <col width="260px" />
                        </colgroup>
                        <tr>
                            <td>
                                <asp:Label ID="KeyLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Key %>" />
                            </td>
                            <td>
                                <asp:TextBox ID="KeyValue" CssClass="ui-input-box ui-fixed-width" runat="server" />
                                <asp:Label runat="server" CssClass="ui-form-label" ForeColor="Red" Text="*" />
                            </td>
                            <td rowspan="3" valign="top" style="padding-left: 50px;">
                                <table cellpadding="5">
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="Optional" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Optional %>"
                                                runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_Optional %>" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="ContextTimeMember" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ContextTimeMember %>"
                                                runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_ContextTimeMember %>" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:CheckBox ID="SuppressTemplateField" CssClass="ui-checkbox ui-checkbox-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_SuppressTemplateField %>"
                                                runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_SuppressTemplateField %>" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="FieldNameLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.ControlText, Label_Name %>" />
                            </td>
                            <td>
                                <asp:TextBox ID="NameValue" CssClass="ui-input-box ui-fixed-width" runat="server" />
                                <asp:Label runat="server" CssClass="ui-form-label" ForeColor="Red" Text="*" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.ControlText, Label_Description %>" />
                            </td>
                            <td>
                                <asp:TextBox ID="DescriptionValue" CssClass="ui-input-box ui-fixed-width" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_ExtendedDescription %>" />
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="ExtendedDescriptionValue" CssClass="ui-input-box ui-fixed-width" Rows="3" TextMode="MultiLine" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="FieldTypeLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_FieldType %>" />
                            </td>
                            <td>
                                <asp:DropDownList ID="FieldTypeList" CssClass="fieldTypeList ui-input-box ui-fixed-width" runat="server" AutoPostBack="true" />
                            </td>
                        </tr>
                        <tr id="GenerateUserInputArea" runat="server" visible="false">
                            <td>
                                <asp:Label ID="GenerateUserInputField" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_GenerateUserInputFieldName %>"
                                    ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_GeneratedUserInputFieldName %>" />
                            </td>
                            <td>
                                <asp:TextBox ID="GenerateUserInput" CssClass="ui-input-box ui-fixed-width" runat="server" />
                            </td>
                        </tr>
                        <tr id="UserInputTypeArea" runat="server" visible="false">
                            <td>
                                <asp:Label ID="UserInputTypeLabel" runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_UserInputType %>"
                                    ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_UserInputFieldType %>" />
                            </td>
                            <td>
                                <asp:DropDownList ID="UserInputTypeList" CssClass="ui-input-box ui-fixed-width" runat="server" />
                            </td>
                        </tr>
                        <tr id="FieldItemInputArea" runat="server" style="display: none;">
                            <td valign="top">
                                <asp:Label runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_FieldValues %>" />
                            </td>
                            <td colspan="2">
                                <table class="fieldItemsTable grid-view">
                                    <tr class="headerRow grid-header">
                                        <th>
                                            <asp:Label runat="server" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Value %>" />
                                        </th>
                                        <th>
                                            <asp:Label runat="server" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_Name %>" />
                                        </th>
                                        <th></th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:TextBox runat="server" CssClass="entryValue ui-input-box" Columns="25" />
                                        </td>
                                        <td>
                                            <asp:TextBox runat="server" CssClass="entryName ui-input-box" Columns="25" />
                                        </td>
                                        <td>
                                            <a id="SaveFieldEntry" class="ui-text ui-link" runat="server">
                                                <asp:Literal runat="server" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_AddReplace %>" />
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                                <input type="hidden" id="FieldItemsHiddenField" runat="server" class="fieldItemsHiddenField" />
                            </td>
                        </tr>
                        <tr id="DefaultValueArea" runat="server">
                            <td>
                                <asp:Label runat="server" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_DefaultValue %>" />
                            </td>
                            <td>
                                <asp:TextBox CssClass="ui-input-box ui-fixed-width" ID="DefaultFieldValue" runat="server" />
                                <zap:ColorButton ID="DefaultColor" runat="server" />
                            </td>
                        </tr>
                        <tr id="AttributeTypeArea" runat="server">
                            <td>
                                <asp:Label ID="AttributeTypeLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_AttributeType %>"
                                    ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_AttributeType %>" runat="server" />
                            </td>
                            <td style="padding-left: 5px;">
                                <asp:TextBox ID="AttributeType" CssClass="ui-input-box ui-fixed-width" Columns="30" runat="server" />
                            </td>
                        </tr>
                        <tr id="MaxGeneratedFieldsArea" runat="server">
                            <td>
                                <asp:Label ID="MaximumGeneratedFieldsLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_MaximumGeneratedFields %>"
                                    ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_MaximumGeneratedFields %>" runat="server" />
                            </td>
                            <td>
                                <zap:SpinEdit ID="MaximumGeneratedFields" runat="server" MinValue="1"
                                    MaxValue="99" Width="60" NumberType="Integer" Increment="1" InitialValue="1" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="DimensionTypeLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_DimensionType %>"
                                    runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_DimensionType %>" />
                            </td>
                            <td>
                                <asp:TextBox ID="DimensionType" CssClass="ui-input-box ui-fixed-width" Columns="30" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="SortOrderLabel" CssClass="ui-form-label" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_SortOrder %>"
                                    runat="server" ToolTip="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, ToolTip_SortOrder %>" />
                            </td>
                            <td>
                                <zap:SpinEdit ID="SortOrder" runat="server" MinValue="1"
                                    MaxValue="99" Width="60" NumberType="Integer" Increment="1" InitialValue="1" />
                            </td>
                        </tr>
                    </table>
                    <asp:Button ID="fieldSave" runat="server" CssClass="ui-button" Text="<%$ Resources: Controls.UserControls.ResourceControls.ExpressionTemplates.ExpressionTemplateText, Label_SaveField %>" />
                    <asp:Button ID="fieldCancel" runat="server" CssClass="ui-button" Text="<%$ Resources: Controls.ControlText, Label_Cancel %>" />
                    <asp:Button Style="display: none;" runat="server" OnClick="SaveField_Clicked" CssClass="invokeFieldSavePostBack ui-button" />
                </div>
            </ContentTemplate>
        </zapWeb:ZapUpdatePanel>
    </div>
</div>

<%--Summary Area--%>
<div runat="server" ID="ExpressionTemplateSummary" class="functionSummary" style="display: none;"></div>