Hi Johan

 

Yeah it must be something like that. But there are multiple rows for this case. I do also have a properties files where the default text are in, im not sure if that has any impact.

 

Somehow it must have slipped my mind that there where the dropdownchoice I guess I’ll just use that instead since it’s the correct one to use.

 

-regards Nino


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johan Compagner
Sent: 9. maj 2006 12:50
To: wicket-user@lists.sourceforge.net
Subject: Re: [Wicket-user] ListChoice changes appearance from dropdown to listbox

 

A ListChoice should always be a List instead of a DropDown (for a drop down we have the DropDownChoice)

I don't know why you see a difference it shouldn't look at all to the model that holds the selection.
It only looks at the choices:

tag.put("size", Math.min(maxRows, getChoices().size()));

so i guess if maxRows of size() == 1 then it becomes a dropdown?

johan

On 5/9/06, Nino Wael <[EMAIL PROTECTED]> wrote:

Hi

 

Im not sure if this is the intended functionality, but I belive I've discovered an oddity or featureJ .

 

When I use the constructor which also takes a model (ListChoice("dropdown_job", new Model(),myList, new myRenderer)) my listchoice is no longer displayed as a dropdown but as a listbox.

 

If I instead of using the constructor with the model property call the set model method (listChoice_job.setModel(new Model())) then it remains displayed as a dropdown

 

Code snipplet:

// this gives a listbox

                                            listChoice_job = new ListChoice("dropdown_job",new Model(),jobcenter.toArray().getList(), new DataItemRenderer())

 

//this gives a dropdown

                                            listChoice_job = new ListChoice("dropdown_job", jobcenter.toArray().getList(), new DataItemRenderer())

                                            listChoice_job.setModel(new Model());

Code snipplet end

 

 

It's that latter I want displayed.

 

 

-regards Nino

 

Reply via email to