Hi folks,
I was able to get a small sample application to work with the validators, but when I use it in my code the validators never seem to execute. Here's the sample I'm working with. It isn't my exact code, but it also doesn't seem to work:
<RadzenTemplateForm TItem="Model" Data="@anatomy">
<div class="row content" style="margin-top: -20px">
<div class="col-12">
<div class="row">
<div class="col-1">
<label for="aisle">Aisle</label>
<RadzenTextBox type="text" class="form-control" Name="Aisle" @bind-value=@anatomy.Aisle />
<RadzenRequiredValidator Component="Aisle" Text="Enter Aisle" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="bay">Bay</label>
<RadzenTextBox type="text" class="form-control" id="bay" Name="Bay" @bind-value=@anatomy.Bay placeholder="loca bay" />
<RadzenRequiredValidator Component="Bay" Text="Enter Bay" Popup="true" Style="position: absolute" />
<RadzenCompareValidator Visible=@(string.IsNullOrEmpty(@anatomy.Bay)) Value=@anatomy.Bay Component="Bay" Text="Passwords should be the same" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="level">Level</label>
<RadzenTextBox type="text" class="form-control" id="level" Name="Level" @bind-value="anatomy.Level" placeholder="loca level" />
<RadzenRequiredValidator Component="Level" Text="Enter Level" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="bin">Bin</label>
<RadzenTextBox type="text" class="form-control" id="bin" Name="Bin" @bind-value="anatomy.Bin" placeholder="loca bin" />
<RadzenRequiredValidator Component="Bin" Text="Enter Bin" Popup="true" Style="position: absolute" />
</div>
<div class="col-3 ">
<label for="levelpickseqdir">Level Pick Sequence Dir</label>
<RadzenSelectBar Size="ButtonSize.Small" TValue="string" Name="LocSequence" @bind-value=@anatomy.LevelPickSequenceDir>
<Items>
<RadzenSelectBarItem Text="ASC" value="asc" />
<RadzenSelectBarItem Text="DESC" value="desc" />
<RadzenSelectBarItem Text="N/A" value="na" />
</Items>
</RadzenSelectBar>
<RadzenRequiredValidator Component="LocSequence" Text="Select Level Pick Sequence Direction" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="bayStep">Bay Step</label>
<RadzenTextBox type="number" class="form-control" id="bayStep" Name="BayStep" @bind-value="anatomy.BayStep" placeholder="loca bay step" />
<RadzenRequiredValidator Component="BayStep" Text="Enter Bay Step" Style="position: absolute" />
</div>
<div class="col-1">
<label for="binStep">Bin Step</label>
<RadzenTextBox type="number" class="form-control" id="binStep" Name="BinStep" @bind-value="anatomy.BinStep" placeholder="loca bin step" />
<RadzenRequiredValidator Component="BinStep" Text="Enter Bin Step" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="pickSeqStep">Seq Step</label>
<RadzenTextBox type="number" class="form-control" id="pickSeqStep" Name="SequenceStep" @bind-value="anatomy.SequenceStep" placeholder="loca pick seq step" />
<RadzenRequiredValidator Component="SequenceStep" Text="Enter Pick Sequence Step" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="LevelsPerLoc">Levels / Loc</label>
<RadzenTextBox type="number" class="form-control" id="LevelsPerLoc" Name="LevelsPerLoc" @bind-value="anatomy.LevelsPerLoc" placeholder="enter # of levels" />
<RadzenRequiredValidator Component="LevelsPerLoc" Text="Enter Levels per Loc" Popup="true" Style="position: absolute" />
</div>
<div class="col-1">
<label for="LevelsPerLoc">Bins / Level</label>
<RadzenTextBox type="number" class="form-control" id="BinsPerLevel" Name="BinsPerLevel" @bind-value="anatomy.BinsPerLevel" placeholder="enter # of bins" />
<RadzenRequiredValidator Component="BinsPerLevel" Text="Enter Bins per Level" Style="position: absolute" />
</div>
</div>
<div class="row">
<div class="fomr-floating col-12">
<RadzenButton BusyText="Inserting Locations..." Text="Insert Missing Locations to Grid" ButtonStyle="ButtonStyle.Primary" ButtonType="ButtonType.Submit" Style="margin-top: 0.5em" />
</div>
</div>
</div>
</div>
</RadzenTemplateForm>
@code {
public class Model
{
public string Bay { get; set; }
public string Aisle { get; set; }
public string Level { get; set; }
public string Bin { get; set; }
public string BinStep { get; set; }
public string BayStep { get; set; }
public string LevelsPerLoc { get; set; }
public string BinsPerLevel { get; set; }
public string SequenceStep { get; set; }
public string LevelPickSequenceDir { get; set; }
}
Model anatomy = new Model();
Things I've already tried:
With and without Radzen Fieldset (my actual code has it)
with and without floating form elements
With and without submit button
with and without submit code in the template form
With my "Model" class named as it's actual class name and as you see in this snippet.
Thanks,
E