Results 1 to 2 of 2
  1. #1
    swapnanair is offline Member
    Join Date
    Nov 2007
    Posts
    3
    Rep Power
    0

    Default To highlight multiple selected values in listbox

    I am working with struts application. I have a registration form where i am using a listbox of multiple selection. I am storing these values concatenating with commas(for eg. A,B,C).Now i have to update this registration form, so i have to retrieve these values and to hightlight the previously selected values.
    I have the idea that first i have to retrieve that field from database and split the commas and then i have to write the code in the front end to display the values.
    But in real time i m unable to display in front end.


    please.....Can anyone help me.
    Last edited by swapnanair; 05-06-2008 at 12:26 PM.

  2. #2
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    If you are using Spring framework then you just have to provide the path of the variable, which is going to store the value(s) of listbox selection, and it will automatically select the specified value.

    Otherwise ( apart from that splitting string using "," )
    you can use String[] also,
    if the valueOfCurrentItemInList==Strin[i] // traverse it
    then used selected keyword

    of listbox.
    i am the future

Similar Threads

  1. Listbox Add/Delete
    By Rageagainst20 in forum New To Java
    Replies: 2
    Last Post: 04-16-2008, 05:49 PM
  2. Adding custom highlight to JEditorPane
    By andrewb in forum AWT / Swing
    Replies: 0
    Last Post: 06-22-2007, 07:48 PM
  3. GNU Source-highlight 2.7
    By levent in forum Java Software
    Replies: 0
    Last Post: 06-12-2007, 09:39 AM
  4. How to select/highlight an entire row in JTextArea
    By Valeriano in forum AWT / Swing
    Replies: 2
    Last Post: 05-28-2007, 12:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •