File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent !! Deleting elements from Combo Box

 
Aman Rustogi
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to delete a few elements from my combo box based on certain condition. I'm able to add contents into Combo Box at run-time using OPtion object but not able to delete.
How can I go about doing this ... plz guide me
Thanking u in advance,
Aman
 
Dave Vick
Ranch Hand
Posts: 3244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aman
I assume your using the options array to add the new items to your list. To delete and item just set its index to null. If you have a list named myList do this:
myList.options[2] = null;
This will remove the 3rd item from the options array and also compress the array. If the original options were 'item1, item2,item3,item4' after the above line it would now be:
'item1,item2,item4'
hope that helps
Dave

PS you'lleed to refresh the page to get the actual list on the screen to change. history.go(0); works but it must be the last thing you do.
 
Aman Rustogi
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx Dave.
But i guess i cannot refresh the page as it contains hell lot of data.
Newayz thx for providing the tip !!
aman
 
Terence Doyle
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Just a suggestion here, but if the form/page contains a lot of data it might be more userfriendly to break it down into several small steps which are presented/filled in separately.
This way the user might feel it's less tedious and you could do your refresh and have more dynamic content!

Terry
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic