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 form....thus
> 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:
>>
>> ...
>> <form wicket:id="Form">
>> <table>
>> <tr>
>> <th>Select Device</th>
>> <td><select wicket:id="devices">
>> <option>Some device</option>
>> </select>
>> </td>
>> </tr>
>> <tr><td colspan="2"><input type="submit" value="submit"/></td></tr>
>> </table>
>> </form>
>>
>> ...
>>
>>
>>
>> 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: [email protected]
For additional commands, e-mail: [email protected]