Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 519309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:01:40+00:00 2026-05-13T08:01:40+00:00

I want to how to create a listbox with a vertical scrollbar in it..

  • 0

I want to how to create a listbox with a vertical scrollbar in it..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:01:40+00:00Added an answer on May 13, 2026 at 8:01 am

    I see that you’re using JSF. You don’t necessarily need plain vanilla HTML here. In real JSF you can render a <select multiple="multiple"> element with the <h:selectManyListbox> component. Here’s a basic example:

    <h:form>
        <h:selectManyListbox value="#{bean.selectedItems}">
            <f:selectItems value="#{bean.selectItems" />
        </h:selectManyListbox>
        <h:commandButton value="submit" action="#{bean.submit}" />
    </h:form>
    

    which is backed like as follows:

    @ManagedBean
    public class Bean {
        private List<String> selectedItems = new ArrayList<String>();
        private List<SelectItem> selectItems = new ArrayList<SelectItem>();
        // Add/generate getters and setters.
    
        public Bean() {
            // Prepopulate selectable items for display.
            this.selectItems.add(new SelectItem("value1", "label1"));
            this.selectItems.add(new SelectItem("value2", "label2"));
            this.selectItems.add(new SelectItem("value3", "label3"));
    
            // If necessary you can also preselect items here.
            this.selectedItems.add("value2"); // Will preselect "value2".
        }
    
        public String submit() {
            // Do your thing with selected items.
            System.out.println("Selected items: " + this.selectedItems);
            return "navigationCaseOutcome";
        }
    }
    

    You can control the layout using CSS through the size, styleClass and/or style attributes of the component, exactly the way as you would do in plain vanilla HTML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create listbox in webpage . the listbox whould have a vertical
alt text http://www.freeimagehosting.net/uploads/abbcae9cd3.png I want to create a listbox like the one shown in
I want to create content type with multiple ListBox's which populate dynamically depending on
I'm trying to create a transparent ListBox in a WPF application. I want the
I want to create a listbox that'll be bound to XPath, relative to the
Hi I want to create a looping listbox so that the last item's next
I want to create an app that has a listbox on the left side
I want to create the content of the each item inside a ListBox dynamically
i want to create a pagination / paging for my listbox. i have a
I want to create a custom control type that behaves exactly like a ListBox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.