Tarun
unread,Aug 11, 2011, 9:25:43 AM8/11/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to visural-wicket
Hey,
I want to use dropdown in my application as done in examples of
cisural wicket and i am using following code for this
DropDownDataSource<User> userDS = new DropDownDataSource<User>() {
public String getName() {
return "users";
}
public List<User> getValues() {
return userDao.getAllUsers();
}
public String getDescriptionForValue(User t) {
return t.getName();
}
};
final Model basicModel = new Model(null);
DropDown assignToSelect = new DropDown("basic", basicModel,
userDS, true);
add(assignToSelect.setCharacterWidth(50));
add(new Label("basicVal", new AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;
@Override
public Object getObject() {
if (basicModel.getObject() == null) {
return "null";
} else {
return basicModel.getObject().toString();
}
}
}));
But on UI instead of seeing dropdown, i see the following
Assignt to :
[Model value = 'null']
It is clear that model value remains null thus it shows null but how
it should be solved. please help.. need very urgent..
Thanks in advance