0

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.

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
ponder275
  • 903
  • 2
  • 12
  • 33

1 Answers1

-1

Change headerKey to "-1". That should fix it.

Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
sam
  • 1