<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<XFormSelector>" %>
<%@ Import Namespace="EPiServer.Shell.Web.Mvc.Html" %>
<%@ Import Namespace="EPiServer.Samples.Models.XFormSearch" %>
<div class="epi-contentArea">
    <input id="gadgetId" type="hidden" value="<%=Model.GadgetId %>" />
    <% Html.BeginGadgetForm("ShowSearchForm"); %>
    <div class="epi-padding-small epi-formArea">
        <fieldset>
            <legend>Available XForms</legend>
            <%=Html.LabeledDropDownList("formId", "Select the XForm to search : ", Model.AvailableForms)%>
        </fieldset>
    </div>
    <% Html.EndForm(); %>
    <% Html.BeginGadgetForm("SearchFormData"); %>
    <div class="epi-padding-small epi-formArea">
        <fieldset>
            <legend>Searchable Fields in XForm</legend>
            <div id="SearchFormTable">
                <% Html.RenderPartial("SearchForm", Model); %>
            </div>
            <%=Html.LabeledRadioButton("resultOption", "Show Count & Results", "true", true) %>
            <%=Html.LabeledRadioButton("resultOption", "Show Count Only", "false", false) %>
            <input type="hidden" id="resultPage" name="resultPage" value="<%= Model.ResultsPage  %>" />
            <div style="padding-top: 12px">
                <%=Html.ShellButton("SearchButton", "Search", null) %>
            </div>
        </fieldset>
        <div id="SearchResultsTable">
            <% Html.RenderPartial("SearchResults", Model); %>
        </div>
    </div>
    <% Html.EndForm(); %>
</div>
