Implementing Tooltip for a Struts select box

Posted on 2011-10-12
Last Modified: 2012-08-13
Hi - I have several items displayed in a struts select box - for each I would like to implement a tooltip for the user - is there any way to do this ?

Question by:abuyusuf35
    1 Comment
    LVL 1

    Accepted Solution

    If I needed to do this, I would:

    1. create a bean that would be used top fill the select list. The bean would have objects for the Label, value and tooltip for each item in the select.
    2. Generate the list of options for the select and put them into an ArrayList<SelectListBean>
    3. Then in the JSP, I would iterate through the ArrayList, adding a tooltip for each item in the select.

    NOTE: the html tag property for what you would call tooltip is "Title" and you can see the usage of the Title property in the code example below.
    <select name="parts" size="5" multiple="true">
        <logic:iterate id="sel" type="com.themaskedcrusader.project.beans.admin.SelectListBean" name="selList" scope="request" indexId="count">
            <option value="<bean:write name="sel" property="value"/>" title="<bean:write name="sel" property="toolTip"/>">
                <bean:write name="sel" property="label"/>

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    what is spring 3 36
    Fibonacci challenge 11 61
    mapBully challenge 6 53
    HashMap Vs TreeMap 12 32
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    The viewer will learn how to implement Singleton Design Pattern in Java.

    760 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

    11 Experts available now in Live!

    Get 1:1 Help Now