I think we'll need to see the code to know the problem. The s:select tag allows you to directly specify an iterable source which would be used to generate the select tag (with options inside) automatically...
I think that whitespace exists where <s: tags /> used to be. Therefore, if you populate your <select> using the <s:select /> itself instead of the iterator your problem may be solved.
I'm still confused. If the whitespaces are in the emitted HTML, who cares? If there are empty option elements, then something's broken, because I'm not sure how they could be generated from the code posted.
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
posted
0
I'm not sure how they could be generated from the code posted.
which is very strange... The problem still persists and I can't use s:select as it would disturb my UI alignment !!!
You still haven't explained *where* the spaces are coming. If it's just in the HTML, then it doesn't matter.
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
posted
0
It's just in the HTML...
but the gap is of the size of the item in the list,so, a user can actually select the space between the two items which looks odd and also if there are 10 items, the list a 19 item drop down,( 9 spaces between 10 items)so it sort of hampers the UI display!
Are you *sure* the list contains what you think it does? It's just not possible for the iterator tag to include objects that aren't in the list.
Note, by the way, that this would be more canonical as:But if you're seeing blank *options*, then it's not "just" in the HTML--it means there are items in the list that aren't displaying.
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
posted
0
But if you're seeing blank *options*, then it's not "just" in the HTML--it means there are items in the list that aren't displaying.
I tried to populate just 2 items say A,B
This is how the dropdown looks like....
-------------
A
B
-------------
instead of ...
--------------
A
B
--------------
may be it's silly but I am unable to solve this one...what else should be the culprit?
If there are only two items in the list then the JSP you posted cannot create empty option elements: all the iterator tag does is loop over the collection and run the body of the tag for each element.
Post the rendered HTML, along with the current JSP code.
Pradeep Adibatla
Ranch Hand
Joined: Oct 27, 2009
Posts: 336
posted
0
Hey David ...thanks for your patient replies...
It is very frustrating though...you mean this should do?
Whoa! that is some comfusion...I thought I need to "Post" the value somewhere...well,well,here it goes, a bit long and the part to be noticed lurks in the middle...
There are two tabpanels both having same structure and so is for select...
Pradeep, the source that you showed us is of the code that you wrote. Now you open that page in the browser and you get some unusual option elements right. Now when you open the page in the browser, depending upon the browser, do the following
If you are using firefox, go to View menu and there's an option called "Page Source", click on that
If you are using Internet Explorer, go to the View menu and there's an option called "Source", click on that
In both cases you'll see the HTML that the browser got from the server. Copy that HTML and post it here...