I have the following <s:select>
tag for a drop down list of states and a default state determined by defaultStateId
.
<s:select name = "stateId"
id = "chooseState"
list = "stateList"
listKey = "codeId"
listValue = "shortDescription"
value = "defaultStateId"
headerKey = "0"
headerValue = "-Select-"
class = "form-control"
tabindex = "12"/>
If the user selects any state and the validation fails the state they chose repopulates on the page when the error is displayed on the page (which is what I want).
But if they choose the headerValue
-Select-
, it does not repopulate even though the stateId
is 0
when the validate()
method runs.
Why does the value="defaultId"
override the choice of -Select-
but not the choice of any state? Any help would be appreciated.