#12 -- Fix form controls

This commit is contained in:
Anton Romanov 2024-11-25 10:54:28 +04:00
parent 13b39eaa25
commit dbcadcb4aa
3 changed files with 6 additions and 5 deletions

View File

@ -5,7 +5,7 @@ import ru.ulstu.db.model.TimeSeriesSet;
public class ChartForm { public class ChartForm {
private TimeSeriesSet set; private TimeSeriesSet set;
private TimeSeriesMeta timeSeriesMeta; private TimeSeriesMeta timeSeriesMeta = null;
private String methodClassName = null; private String methodClassName = null;
private boolean needForecast; private boolean needForecast;

View File

@ -124,7 +124,8 @@
$('#select-ts').selectpicker('refresh'); $('#select-ts').selectpicker('refresh');
</script> </script>
<input id="need-forecast" type="hidden" th:field="*{needForecast}"> <input id="need-forecast" type="hidden" th:field="*{needForecast}">
<button type="button" class="btn btn-primary" onclick="$('#need-forecast').val(true); form.submit();"> <button th:if="*{timeSeriesMeta != null && !#strings.isEmpty(timeSeriesMeta.key)}" type="button"
class="btn btn-primary" onclick="$('#need-forecast').val(true); form.submit();">
Построить прогноз Построить прогноз
</button> </button>
<h5 th:if="${forecastDescription != null && forecastDescription.timeSeriesMethod != null}"> <h5 th:if="${forecastDescription != null && forecastDescription.timeSeriesMethod != null}">

View File

@ -145,11 +145,11 @@
<script th:inline="javascript" th:if="*{methodClassName != null && methodClassName != ''}"> <script th:inline="javascript" th:if="*{methodClassName != null && methodClassName != ''}">
$('#select-method').val([[*{methodClassName}]]); $('#select-method').val([[*{methodClassName}]]);
$('#select-method').selectpicker('refresh'); $('#select-method').selectpicker('refresh');
</script> </script>
<input id="need-forecast" type="hidden" th:field="*{needForecast}"> <input id="need-forecast" type="hidden" th:field="*{needForecast}">
<button type="button" class="btn btn-primary" onclick="$('#need-forecast').val(true); form.submit();"> <button th:if="*{methodClassName != null && methodClassName != ''}" type="button"
class="btn btn-primary" onclick="$('#need-forecast').val(true); form.submit();">
Построить прогноз Построить прогноз
</button> </button>
<div th:if="${forecastDescription != null && forecastDescription.timeSeriesMethod != null}"> <div th:if="${forecastDescription != null && forecastDescription.timeSeriesMethod != null}">