Solved

Horizontal Scroll bar for a ListBox

Posted on 2004-04-20
28
1,564 Views
Last Modified: 2012-05-04
HI Experts,

I need to add a Horizontal Scrollbar for a List box in the JSP page which I have. I am using the <select> tag for creating a listbox. Could anyone of U please help me out in getting a horizontal scroll bar for this list box?

Irfyy
0
Comment
Question by:Irfyy
  • 13
  • 9
  • 4
28 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 10867859
You can't I don't think...

The only thing you could do, is put your list on another JSP, and load it as an IFRAME in the first JSP

http://www.htmlhelp.com/reference/html40/special/iframe.html

Or write it as a java applet (or flash or activex or something)
0
 
LVL 6

Expert Comment

by:jarasa
ID: 10867877
Send this question to the HTML Area but I'm not really sure you can maybe with an style.

Javier
0
 

Author Comment

by:Irfyy
ID: 10867881
Could anyone please help me in achieving this?

Irfyy
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10867932
Have you looked into doing it as an IFrame?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10867941
Try:

<select style='overflow:auto;'>

But that will not work on IE, only mozilla...
0
 

Author Comment

by:Irfyy
ID: 10867954
I tried this <select style='overflow:auto;'>... Not working...
0
 

Author Comment

by:Irfyy
ID: 10867961
I didnt get the IFrame concept... Would be great if U explain giving an example
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868010
0
 

Author Comment

by:Irfyy
ID: 10868079
This wont help my code as I use the selected listbox items to fetch some data from the database...

Any other solution?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868097
Make the things that go into the list shorter...

ie:  after 10 characters length, add "..." to the end, etc...
0
 

Author Comment

by:Irfyy
ID: 10868109
I cant do that... My client wants the entire string to be put in the list box.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868156
Hmmmmm....

Can't be done then (with HTML) :-(

What I would do, is put the shortened string in the listbox, and add an "onChange" javascript event that puts the full text into a div when the selection changes...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868162
as jarasa said, maybe you'd get a better response over on the HTML TA

http://www.experts-exchange.com/Web/Web_Languages/HTML/

But I think they will say the same thing...
0
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

 
LVL 6

Expert Comment

by:jarasa
ID: 10868449
But you want it to be a dropdown?
How long is your text?
Javier
0
 

Author Comment

by:Irfyy
ID: 10868583
No I dont want it to be a drop down.. Beacuse the users might need to multi select from the list box which cannot be achieved using a dropdown!

The text size varies.... Cant fix it... :-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868591
Can't do anything then...  You're going to have to talk to the client about a compromise, as they can't have what they want...  HTML doesn't work that way... :-(
0
 

Author Comment

by:Irfyy
ID: 10868609
Oopsss....

ok.. any way I can give a Tool Tip for the selected text?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868639
You could try:

<select id="list" name="list">
  <option title="Your really long text goes here" value="1">Your really lo...</option>
  <option title="And this is another really long bit of text for the tooltip" value="2">And this is ano...</option>
</select>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868646
But again, that may not work in IE

:-(
0
 

Author Comment

by:Irfyy
ID: 10868713
NOt wroking...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868727
you using IE yeah?
0
 

Author Comment

by:Irfyy
ID: 10868745
Yes... Any other way to include a Tool Tip?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 75 total points
ID: 10868772
Not for IE...

Although this might work:

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm

you'd have to try it out though (with select), he only shows links and divs working...

Tim
0
 
LVL 6

Assisted Solution

by:jarasa
jarasa earned 75 total points
ID: 10868947
Well Tim actually there is a way you can simulate a multiselect listbox with horizontal and vertical bars.

but is a bit complex.

You have to fill up a <table> inside a fixed size <DIV> the scrolls will appear as needed and you can put the values inside hidden <Inputs> the on the <TR onClick> you can chenge the <TR bgcolor> and keep it checked with a checkBox

hmm I'm not sure if I've explained well, if you want to give it a try I'll post you some code.

Javier
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10868970
Ahhhh... of course...  but you then have to maintain the list of selected items, and what happens when the form is submitted?  

Oh hang on, I see...checkboxes :-)

Cool workaround :-)
0
 
LVL 6

Expert Comment

by:jarasa
ID: 10869037
;c)

0

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

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SimpleDateFormat.parse examples 19 84
best way to search/remove a file from an EAR file 3 96
maven project jars 7 46
equalIsNot  challenge 43 117
A procedure for exporting installed hotfix details of remote computers using powershell
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 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

19 Experts available now in Live!

Get 1:1 Help Now