I am trying to have a way for the user to specify the number of inputs for a certain section of the Settings page in my module. I want the user to be able to enter a number (e.g. 5), click "Update", reload the Settings, and see five new text boxes. I have done this in an MVC module like so:
<div class="dnnFormItem">
@Dnn.Label("QueryParamCount", "Count", "Number of URL parameters")
@Html.TextBoxFor(m => Model.QueryParamCount)
</div><br />
if (Model.QueryParamCount > 0)
{
<div>
@Dnn.Label("QueryParamList", "Parameters", "List of URL parameters;" +
"Valid data types are: bigint, bit, smallint, decimal, smallmoney, int, tinyint, money, float, real, date, datetimeoffset, datetime2," +
"smalldatetime, datetime, time, nchar, nvarchar")
<br />
<table id="ParameterTable_@Dnn.ModuleContext.TabModuleId" align="center">
<colgroup>
<col style="width:200px" title="Value" />
<col style="width:150px" title="Data Type" />
</colgroup>
@for (int i = 0; i < Model.QueryParamCount; i++)
{
<tr>
<td>
@Html.TextBoxFor(m => m.QueryParamList[i].Value, new { placeholder = "Name" })
</td>
<td>
@Html.TextBoxFor(m => m.QueryParamList[i].DataType, new { placeholder = "Type" })
</td>
</tr>
}
</table>
</div><br />
}
Because of how the module that I am currently working on does not have the concept of a "Model," I cannot use the same approach. Is what I am trying to do even possible without resorting to MVC?