• Post Reply Bookmark Topic Watch Topic
  • New Topic

Expandable h:selectOneMenu  RSS feed

 
Muhammad Ijaz
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on a web application developed with JSF 1.2. I have used h:selectOneMenu on many pages. I have used its style attributed as following.


Most of the time #{abcBean.nameList} contains large names that could not fit into the style="width:150px". Whenever I open my pages into Firefox and open the dropdown menu, the dropdown automatically expands if the #{abcBean.nameList} contains large names. But this is not the case with IE. Whenever I open it with IE and if #{abcBean.nameList} contains large names, the dropdown does not shows me complete names... Please help me how to fix this issue at IE. I cannot increase the the style width because some name maybe again more large than the increased width. Also I cannot remove the style attribute becuase then it can spoil my page design.

Pomy
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could set the style dynamically... So that if the dropdown contains a value that would make it wider, the control will automatically expand itself...



Have 150 as the default value for boxWidth and if an item is added to the nameList that's wider than will fit there, you could change the value of boxWidth to accommodate it.
 
Muhammad Ijaz
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Firefox dropdown box remains constant but when we click on dropdown box, the dropdown List expands itself. 'DropDown box' is what we view without clicking on it, and 'Dropdown List' is what we see when we click on the 'dropdown box'.
So if we set the style attribute even dynamically, on EI the Dropdown box expand itself without clicking on it, while our requirement is only Dropdown list should exapand not the 'dropdown box'. Because if 'Dropdown box' expands then the design of the page gets disturbed.
 
Muhammad Ijaz
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any Help Please....
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand correctly, you want the control itself to remain at a fixed width, but you want the actual drop down list part that displays the items to size itself according to the length of the Strings in it?
 
Muhammad Ijaz
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are right. On firefox it works fine by default, but it does not work on IE as on Firefox.

Please help me to fix this issue
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!