Struts help needed in Increasing the width of the options tag

Posted on 2007-08-03
Last Modified: 2013-11-24
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"/>  
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..

Question by:json123
    LVL 14

    Expert Comment

    Use non-breaking space to avoid browser removing leading/trailing white space.
    <html:option value="">First &nbsp;&nbsp;&nbsp;&nbsp; Second &nbsp;&nbsp;&nbsp;&nbsp; Third</html:option>

    Boon Leng

    Author Comment

    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

    Author Comment

    Thanks Boon  It was my are right it is working now thanks for the solution.

    Author Comment

    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
    LVL 14

    Accepted Solution

    You can set the attribute "filter" to false to disable url encoding.
    <html:optionsCollection ... filter="false"/>  

    Author Comment

    Thank you so much Boon it worked...

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Unable to open debugger port in Intellij idea 6 40
    countAbc challenge 9 35
    countHi2 challenge 7 31
    wordappend challenge 8 54
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now