开发者

How to add a header to h:selectmanylistbox (In code)

I'm doing this from code but it should be equivalent to jsp..

Trying to have a header for a selectmanylistbox. (I'm looking for the same look as a header on a table column would have.) What I'm trying now is: (The relevant code)

HtmlSelectManyListbox list =开发者_开发知识库 new HtmlSelectManyListbox();

HtmlOutputText headerText = new HtmlOutputText();
headerText.setValue("Testing");

list.getFacets().put("header",headerText);

The list doesn't show a header. Anyone knows why??

Thanks!


The <h:selectManyListBox> does not support any <f:facet>. So you will have to create it manually. In fact, it really depends on what you are looking for.

You can use a <div> and play with the CSS classes to have your required look and feel, or use a <fieldset> HTML tag:

<fieldset>
    <legend>Your choice:</legend>
    <h:selectManyListBox value="...">
        <f:selectItems value="..."/>
    </h:selectManyListBox>
</fieldset>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜