Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
11. Mar 2010, 15:44 America/New_York | Link

I have a tiny h:selectOneMenu populated by s:selectItems.

Some of the data have big length and I need to show it somehow.

In firefox it's alright, it maximizes the option fields so they can display the longest label of the options.

The problem is IE, it is cutting the labels and I don't know a way to show a title or maximize the options like Firefox does.

Thought about setting titles using javascript, but couldn't find a way.

Any help? Thanks.

2 Replies:
12. Mar 2010, 17:16 America/New_York | Link

Hello,

Try this:

<h:selectOneMenu value="#{a.b.xx}" title="#{a.b.xx}"
   onchange="this.title = this.options[this.selectedIndex].text">

Could require some tweaking, but that is the general idea.

12. Mar 2010, 19:40 America/New_York | Link
Actually I wanted to set titles for the <option>s of the <select>.

Already found a way, but thanks anyway.

Here is the code, for history:

<script language="text/javascript">
    var options = document.getElementsByTagName("option");
    for (var optIndex in options)
        options[optIndex].title = options[optIndex].text;
</script>