Re: problem with dropdownchoice

2009-01-20 Thread itayke

Hi,

Seem like the problem is solved by adding a "Device" class member and these
getter and setter to the FormInput class:

public Device getDevices(){
return new Device();
}


public void setDevices(Device d){
device = d;
}


thanks for your help.





Alex Objelean wrote:
> 
> 
> Wicket expects that FormInput would have a getter for devices. This
> happens because you are using CompoundPropertyModel with your formthus
> the wicket id is automatically used as a propertyModel on the form model
> object. 
> 
> Alex Objelean
> 
> 
> itayke wrote:
>> 
>> Hi,
>> 
>> I have this problem with my dropdownchoice with results in 
>> WicketMessage: No get method defined for class: class
>> screens.CustomerFilters$FormInput expression: devices
>> 
>> were the java class has:
>> 
>>  public CustomerFilters(){
>>  super();
>>  FormInput formInput = new FormInput("Form");
>>  setModel(new CompoundPropertyModel(formInput));
>>  add(formInput);
>>..
>> 
>>  }
>> 
>> 
>> and the form class:
>> 
>>  public class FormInput extends Form{
>> 
>>  String deviceID;
>>  
>>  public FormInput(String id) {
>>  super(id);
>>  
>>  DropDownChoice ddc = 
>>  new DropDownChoice("devices", 
>>  getDevicesList(), //this will 
>> return a list of Device POJOs
>>  new IChoiceRenderer() { 
>>  public Object getDisplayValue(Object 
>> object) { 
>>  return 
>> ((Device)object).getDeviceName(); 
>>  } 
>>  public String getIdValue(Object object, 
>> int index) { 
>>  return 
>> ((Device)object).getDeviceID(); 
>>  } 
>>  }); 
>> 
>>  add(ddc);
>>  }
>> 
>> I also have a simple "Device" POJO class with getters and setters.
>> The HTML looks like that:
>> 
>> ...
>> 
>> 
>> 
>> Select Device
>> 
>> Some device
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ...
>> 
>> 
>> 
>> Any ideas what i'm doing wrong?
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/problem-with-dropdownchoice-tp21563513p21564437.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



problem with dropdownchoice

2009-01-20 Thread itayke

Hi,

I have this problem with my dropdownchoice with results in 
WicketMessage: No get method defined for class: class
screens.CustomerFilters$FormInput expression: devices

were the java class has:

public CustomerFilters(){
super();
FormInput formInput = new FormInput("Form");
setModel(new CompoundPropertyModel(formInput));
add(formInput);
   ..

 }


and the form class:

public class FormInput extends Form{

String deviceID;

public FormInput(String id) {
super(id);

DropDownChoice ddc = 
new DropDownChoice("devices", 
getDevicesList(), //this will 
return a list of Device POJOs
new IChoiceRenderer() { 
public Object getDisplayValue(Object 
object) { 
return 
((Device)object).getDeviceName(); 
} 
public String getIdValue(Object object, 
int index) { 
return 
((Device)object).getDeviceID(); 
} 
}); 

add(ddc);
}

I also have a simple "Device" POJO class with getters and setters.
The HTML looks like that:

...



Select Device

Some device







...



Any ideas what i'm doing wrong?

-- 
View this message in context: 
http://www.nabble.com/problem-with-dropdownchoice-tp21563513p21563513.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org