Here is an example of the method in the page backing bean
public Option[] getOptions() {
List<Option> options = new ArrayList<Option>();
personDataProvider.cursorFirst();
Option firstOption = new Option(personDataProvider.getValue("PERSON.PERSONID"), (String) personDataProvider.getValue("
PERSON.NAME"));
options.add(firstOption);
Option filler = new Option(99999, "----------");
options.add(filler);
while (personDataProvider.cursorNext()) {
Option option = new Option(personDataProvider.getValue("PERSON.PERSONID"), (String) personDataProvider.getValue("
PERSON.NAME"));
options.add(option);
}
return options.toArray(new Option[options.size()]);
}
Here is the component binding
<webuijsf:dropDown id="dropDown2" items="#{Page1.options}" label="Option List With Filler" style="left: 72px; top: 72px; position: absolute"/>
Here is an example of how to do it including source code on my blog.
On Fri, May 22, 2009 at 5:20 AM, ouribeb930
<ouribeb930@...> wrote:
Hi, :D
I got a question about the Drop Down List component for the visual web.
I got a binding to a database for the component items, there are four of them the component is something like this:
[1, "Value one"]
[2, "Value two"]
[3, "Value three"]
[4, "Value four"]
But I need to do this plus something more:
[1, ""]
[___________]
[2, "Value one"]
[2, "Value two"]
[2, "Value three"]
[2, "Value four"]
I mean, I want a first value with no label, a line separator and the database values.
Is this posible???
Can anybody helpme with this please.
Thanks!!
--
John Yeary
--
http://javaevangelist.blogspot.com"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the grey twilight that knows not victory nor defeat."
-- Theodore Roosevelt