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 7854815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:11:50+00:00 2026-06-02T20:11:50+00:00

I have a select: <h:selectOneMenu id=treeNode label=#{msgs.treeNode} value=#{treeNode}> <f:selectItems value=#{treeItems} /> </h:selectOneMenu> which uses

  • 0

I have a select:

<h:selectOneMenu id="treeNode" label="#{msgs.treeNode}" value="#{treeNode}">
  <f:selectItems value="#{treeItems}" />
</h:selectOneMenu>

which uses these selectItems:

List<SelectItem> treeItems = new ArrayList<SelectItem>();
treeItems.add(new SelectItem("1", "Parent"));
treeItems.add(new SelectItem("2", "  Child 0 0"));
treeItems.add(new SelectItem("2", "    Child 0 0 0"));
treeItems.add(new SelectItem("2", "    Child 0 0 1"));
treeItems.add(new SelectItem("2", "  Child 0 1"));

My problem is that the output in the select should look like a tree, but since the whitspaces are gone I have a “flat”-view.

Is there a way how I could convert the whitspaces into a nonbreakable-space?

Thanks
Jonny

  • 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-06-02T20:11:51+00:00Added an answer on June 2, 2026 at 8:11 pm

    Just replace them by &nbsp; yourself and set the escape attribute to false. It’s the 5th argument of the SelectItem constructor.

    List<SelectItem> treeItems = new ArrayList<SelectItem>();
    treeItems.add(new SelectItem("1", "Parent", null, false, false));
    treeItems.add(new SelectItem("2", "&nbsp;&nbsp;Child 0 0", null, false, false));
    treeItems.add(new SelectItem("3", "&nbsp;&nbsp;&nbsp;&nbsp;Child 0 0 0", null, false, false));
    treeItems.add(new SelectItem("4", "&nbsp;&nbsp;&nbsp;&nbsp;Child 0 0 1", null, false, false));
    treeItems.add(new SelectItem("5", "&nbsp;&nbsp;Child 0 1", null, false, false));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this SelectOneMenu: <h:selectOneMenu value=#{orderController.requestVO.requestSituation}> <f:converter converterId=ComboConverter/> <f:selectItems value=#{orderController.requestSituation} var=requestSituation itemLabel=#{requestSituation.description} itemValue=#{requestSituation} />
i have select <select id=parentId name=parentId><option value=1>ФАСАДНАЯ ШТУКАТУРКА&lt;BR /&gt;&lt;B&gt;&amp;#0171;STUC-O-FLEX&amp;#0187;&lt;/B&gt;</option> <option value=2>ФОНТАНЫ И САДОВАЯ МЕБЕЛЬ&lt;BR
Let's say I have SELECT name FROM table which gives me something like foo
i have a table with columns ID,SUBJECT,BRANCH i have select the rows which satisfies
I have a custom converter to select a Country in a SelectOneMenu component: File:
I have three drop down list <h:selectOneMenu> , and a <p:dataTable> . I want
I have the following peace of code: <h:selectOneMenu id=countrycode styleClass=Width300 value=#{customer.countrycode} valueChangeListener=#{customer.countrycodechange} onchange=submit() immediate=true
I have select list items looking like this: <option>- Data source A -</option> <option>-
I have a <h:selectOneMenu> that renders the value of the cardStatus from my object
In a create new user jsf page, I have a SelectOneMenu with a custom

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.