• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Struts help needed in Increasing the width of the options tag

Hi,
I wanted to display the options tag with three values parted by speces. Here is my jsp
<html:select property="selReleaseId" name="planForm">
                  <html:option value="" >First                  Second                     Third </html:option>
                  <html:optionsCollection name="planningForm" property="ftaRelease" value="respectiveId" label="label"/>  
               </html:select>
I wanted it to show exactly with first after some spaces then second and then third. Also I tried creating the lavel by appending same values and spaces but it is still removing the spaces and showing. Can any one help me to fix this..

Thanks
Json
0
json123
Asked:
json123
  • 4
  • 2
1 Solution
 
boonlengCommented:
Use non-breaking space to avoid browser removing leading/trailing white space.
Example:
<html:option value="">First &nbsp;&nbsp;&nbsp;&nbsp; Second &nbsp;&nbsp;&nbsp;&nbsp; Third</html:option>

Regards,
Boon Leng
0
 
json123Author Commented:
Hi Boon Leng,
I tried that but it is showing in the drop down as &nbps; itself. IT is showing exactly like  First &nbsp;&nbsp;&nbsp;&nbsp; Second &nbsp;&nbsp;&nbsp;&nbsp; Third  . It is not substituting the spaces.

Thanks for your replay
Json
0
 
json123Author Commented:
Thanks Boon  It was my fault.....you are right it is working now thanks for the solution.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
json123Author Commented:
header is good now but for the result , I appended all three fields in my bean and tried to adjust the space there, that is where I am getting the &nbsp displayed. I put a method into bean called getLabel and that will append all those First second and third field and display to the Options. But how can I get spaces there. Is there any other way like I could achieve this?  Thanks for all your help
0
 
boonlengCommented:
You can set the attribute "filter" to false to disable url encoding.
Example:
<html:optionsCollection ... filter="false"/>  
0
 
json123Author Commented:
Thank you so much Boon it worked...
json
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now