Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4525

s:select with an inside iterator through option group

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: 2.3.28
    • Component/s: None
    • Labels:
      None

      Description

      Please look at below code:

      Bar.jsp
      <s:select id="toAccount" name="destinationKnownAccount"
                          list="destinationKnownAccounts" listKey="accountNo"
                          listValue="%{ farsiFirstName + \" \" + farsiLastName }" >
                            <s:iterator value="destinationKnownAccounts">  
                              <optgroup label="${farsiFirstName}">  
                                       <option value="${accountNo}"> ${accountNo}</option>  
                               </optgroup>  
                          </s:iterator>                   
                      </s:select> 
      

      The optiongroup will be displayed outside select as

      Bar.jsp
        
      <optgroup label="محمد"> <option value="012222946005"> 012222946005</option>  
      </optgroup>  
      <optgroup label="حامد"> <option value="0333783051000"> 0333783051000</option>  
      </optgroup>  
      <optgroup label="سارا"> <option value="0100005087000"> 0100005087000</option>  
      </optgroup>  
       <select name="destinationKnownAccount" id="toAccount" >
          <option value=""  >   </option>
          <option value="012222946005">012222946005 محمد رادان</option>
          <option value="0333783051000">0333783051000 حامد پیروزفر</option>
          <option value="0100005087000">0100005087000 سارا حاتمی</option>
      </select>
      

      I tried other ways, even copy a static option group but same result, only s:optgroup workes fine and generates the option group inside option

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              afattahi Alireza Fattahi

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment