I think your issue is with the way you set it up.
It looks to me as if your DropDownChoice is isolated from your data
model so that when the form submits you getting the property set to
null, which it is in the input.
could of things to try:
- use a property model for the form model.
- name
The category is still null. Could someone tell me where it goes wrong?
Thanks,
Hbiloo
On Sat, Feb 28, 2009 at 6:39 PM, Azzeddine Daddah wrote:
> The Recipe object is indeed serializable. Below some code from
> the AddRecipeForm and Recipe:
>
> public class Recipe implements Serializable {
>
The Recipe object is indeed serializable. Below some code from
the AddRecipeForm and Recipe:
public class Recipe implements Serializable {
public static final int NAME_LENGTH = 50;
public static final int DIFFICULTY_LENGTH = 6;
public static final int INTRODUCTION_LENGTH =
where is the code that creates your form? and is Recipe serializable?
-igor
On Sat, Feb 28, 2009 at 8:58 AM, Azzeddine Daddah wrote:
> Thanks Igor,
> I've already tried that but still have the same problem.
> add(new CategoriesDropDown("categories", new PropertyModel(recipe,
> "category")).setRe
Thanks Igor,
I've already tried that but still have the same problem.
add(new CategoriesDropDown("categories", new PropertyModel(recipe,
"category")).setRequired(true));
...
private class CategoriesDropDown extends DropDownChoice {
public CategoriesDropDown(String id, IModel model) {
use a property model instead of recipe.getcategories()
-igor
On Sat, Feb 28, 2009 at 8:17 AM, Azzeddine Daddah wrote:
> Hi,
> I'm trying to use a DropDownChoice to display and store the selected
> category in the database. The value selected in the drop down is correctly
> set, but when I look t
Hi,
I'm trying to use a DropDownChoice to display and store the selected
category in the database. The value selected in the drop down is correctly
set, but when I look to the model (Category) of this drop down, it returns
always null. Do I do something wrong? Below some code.
public AddRecipeForm