0

I have the following selectOneMenu

<h:selectOneMenu styleClass="classA classB" 
    id="listID"
    required="true" requiredMessage="Required"
    value="#{model.selected}"
    effect="fade"
    hideNoSelectionOption="true"
    disabled="#{empty model.list}">
    <f:selectItem itemValue="#{null}" itemLabel="#{null}" noSelectionOption="true" />
    <f:selectItems value="#{model.list}"/>
    <p:ajax event="change" process="@this" update="listID msgList" />
</h:selectOneMenu>

selectOneMenu img

Is it possible to display 2 lines for each element, one containing the name and the other containing the description? 2 Lines for a single selectable item.

I tried to concatenate '\n' '&010;' '&013;' 'br tag' to the string to display but nothing, apparently the carriage return doesn't work on the option tag (selectItems)

Is it possible to do this?

Thanks in advance

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
loresd2
  • 1
  • 1
  • 2
    [Please do not upload images of code/data/errors.](//meta.stackoverflow.com/q/285551) Instead, edit your question to include the code as properly formatted text. – seenukarthi May 22 '23 at 09:41
  • Does this answer your question? [Line break in HTML with '\n'](https://stackoverflow.com/questions/39325414/line-break-in-html-with-n) – Jasper de Vries May 22 '23 at 09:45

0 Answers0