You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by vahid ghasemi <va...@gmail.com> on 2021/09/25 16:46:29 UTC

add Dropdown object to List

Hello guys.
I have a dropdown and I want to use CompoundPropertyModel OR PropertyModel.
the attribute of my model is List and the wicket can't set the
drop-down model object to List.
what is your option to handle this?

Re: add Dropdown object to List

Posted by Martin Terra <ma...@koodaripalvelut.com>.
Selection is an object. If you want to transform it to a singleton later it
is a separate process. Or you need to build a model that does that, but for
PoC purposes I suggest you keep it simple and do by the book without list
at receiver.

**
Martin

su 26. syysk. 2021 klo 21.12 vahid ghasemi (vahidghasemi119@gmail.com)
kirjoitti:

> So it's not any option to handle this issue?
> I have list but it's singleton list :(
>
> On Sun, Sep 26, 2021, 6:17 PM Martin Terra <
> martin.terra@koodaripalvelut.com>
> wrote:
>
> > Choices model should be final and the selection model should be one item
> > not a list
> >
> >
> >
> > On Sun, Sep 26, 2021, 17:36 vahid ghasemi <va...@gmail.com>
> > wrote:
> >
> > > model class :
> > > class User {
> > > private List<SomeThing> someThing;
> > > }
> > >
> > > Page class :
> > > private User user;
> > > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > > PropertyModel(user,"someThing", ....);
> > >
> > > and this is my problem.
> > > how can I add the drop-down model to the user property which is list,
> > with
> > > PropertyModel
> > >
> > >
> > > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > > martin.terra@koodaripalvelut.com> wrote:
> > >
> > > > Hi!
> > > >
> > > > Can you paste some code with your exact (generic) variables which
> > doesn't
> > > > work, it might be easier to figure out from code example than verbal
> > > > description?
> > > >
> > > > **
> > > > Martin
> > > >
> > > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (
> vahidghasemi119@gmail.com)
> > > > kirjoitti:
> > > >
> > > > > Hello guys.
> > > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > > PropertyModel.
> > > > > the attribute of my model is List and the wicket can't set the
> > > > > drop-down model object to List.
> > > > > what is your option to handle this?
> > > > >
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by Martin Terra <ma...@koodaripalvelut.com>.
I'd recommend: Keep it simple, implement using dropdownchoice and simply
convert to a list in your selection model if you need a list for domain
model purposes (I cannot comprehend why you would use a list to represent a
single selection).

**
Martin

ti 28. syysk. 2021 klo 10.57 vahid ghasemi (vahidghasemi119@gmail.com)
kirjoitti:

> Can I limit the users' choice number in ListMultipleChoice?
>
> On Mon, Sep 27, 2021 at 9:41 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > On Sun, Sep 26, 2021 at 9:12 PM vahid ghasemi <vahidghasemi119@gmail.com
> >
> > wrote:
> >
> > > So it's not any option to handle this issue?
> > > I have list but it's singleton list :(
> > >
> >
> > You need to use ListMultipleChoice instead of DropDownChoice.
> >
> >
> > > On Sun, Sep 26, 2021, 6:17 PM Martin Terra <
> > > martin.terra@koodaripalvelut.com>
> > > wrote:
> > >
> > > > Choices model should be final and the selection model should be one
> > item
> > > > not a list
> > > >
> > > >
> > > >
> > > > On Sun, Sep 26, 2021, 17:36 vahid ghasemi <vahidghasemi119@gmail.com
> >
> > > > wrote:
> > > >
> > > > > model class :
> > > > > class User {
> > > > > private List<SomeThing> someThing;
> > > > > }
> > > > >
> > > > > Page class :
> > > > > private User user;
> > > > > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > > > > PropertyModel(user,"someThing", ....);
> > > > >
> > > > > and this is my problem.
> > > > > how can I add the drop-down model to the user property which is
> list,
> > > > with
> > > > > PropertyModel
> > > > >
> > > > >
> > > > > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > > > > martin.terra@koodaripalvelut.com> wrote:
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > Can you paste some code with your exact (generic) variables which
> > > > doesn't
> > > > > > work, it might be easier to figure out from code example than
> > verbal
> > > > > > description?
> > > > > >
> > > > > > **
> > > > > > Martin
> > > > > >
> > > > > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (
> > > vahidghasemi119@gmail.com)
> > > > > > kirjoitti:
> > > > > >
> > > > > > > Hello guys.
> > > > > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > > > > PropertyModel.
> > > > > > > the attribute of my model is List and the wicket can't set the
> > > > > > > drop-down model object to List.
> > > > > > > what is your option to handle this?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Sep 28, 2021 at 10:57 AM vahid ghasemi <va...@gmail.com>
wrote:

> Can I limit the users' choice number in ListMultipleChoice?
>

You could use a validator for this
formComponent.add(new IValidator() {...});


>
> On Mon, Sep 27, 2021 at 9:41 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
> > Hi,
> >
> > On Sun, Sep 26, 2021 at 9:12 PM vahid ghasemi <vahidghasemi119@gmail.com
> >
> > wrote:
> >
> > > So it's not any option to handle this issue?
> > > I have list but it's singleton list :(
> > >
> >
> > You need to use ListMultipleChoice instead of DropDownChoice.
> >
> >
> > > On Sun, Sep 26, 2021, 6:17 PM Martin Terra <
> > > martin.terra@koodaripalvelut.com>
> > > wrote:
> > >
> > > > Choices model should be final and the selection model should be one
> > item
> > > > not a list
> > > >
> > > >
> > > >
> > > > On Sun, Sep 26, 2021, 17:36 vahid ghasemi <vahidghasemi119@gmail.com
> >
> > > > wrote:
> > > >
> > > > > model class :
> > > > > class User {
> > > > > private List<SomeThing> someThing;
> > > > > }
> > > > >
> > > > > Page class :
> > > > > private User user;
> > > > > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > > > > PropertyModel(user,"someThing", ....);
> > > > >
> > > > > and this is my problem.
> > > > > how can I add the drop-down model to the user property which is
> list,
> > > > with
> > > > > PropertyModel
> > > > >
> > > > >
> > > > > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > > > > martin.terra@koodaripalvelut.com> wrote:
> > > > >
> > > > > > Hi!
> > > > > >
> > > > > > Can you paste some code with your exact (generic) variables which
> > > > doesn't
> > > > > > work, it might be easier to figure out from code example than
> > verbal
> > > > > > description?
> > > > > >
> > > > > > **
> > > > > > Martin
> > > > > >
> > > > > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (
> > > vahidghasemi119@gmail.com)
> > > > > > kirjoitti:
> > > > > >
> > > > > > > Hello guys.
> > > > > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > > > > PropertyModel.
> > > > > > > the attribute of my model is List and the wicket can't set the
> > > > > > > drop-down model object to List.
> > > > > > > what is your option to handle this?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by vahid ghasemi <va...@gmail.com>.
Can I limit the users' choice number in ListMultipleChoice?

On Mon, Sep 27, 2021 at 9:41 AM Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> On Sun, Sep 26, 2021 at 9:12 PM vahid ghasemi <va...@gmail.com>
> wrote:
>
> > So it's not any option to handle this issue?
> > I have list but it's singleton list :(
> >
>
> You need to use ListMultipleChoice instead of DropDownChoice.
>
>
> > On Sun, Sep 26, 2021, 6:17 PM Martin Terra <
> > martin.terra@koodaripalvelut.com>
> > wrote:
> >
> > > Choices model should be final and the selection model should be one
> item
> > > not a list
> > >
> > >
> > >
> > > On Sun, Sep 26, 2021, 17:36 vahid ghasemi <va...@gmail.com>
> > > wrote:
> > >
> > > > model class :
> > > > class User {
> > > > private List<SomeThing> someThing;
> > > > }
> > > >
> > > > Page class :
> > > > private User user;
> > > > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > > > PropertyModel(user,"someThing", ....);
> > > >
> > > > and this is my problem.
> > > > how can I add the drop-down model to the user property which is list,
> > > with
> > > > PropertyModel
> > > >
> > > >
> > > > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > > > martin.terra@koodaripalvelut.com> wrote:
> > > >
> > > > > Hi!
> > > > >
> > > > > Can you paste some code with your exact (generic) variables which
> > > doesn't
> > > > > work, it might be easier to figure out from code example than
> verbal
> > > > > description?
> > > > >
> > > > > **
> > > > > Martin
> > > > >
> > > > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (
> > vahidghasemi119@gmail.com)
> > > > > kirjoitti:
> > > > >
> > > > > > Hello guys.
> > > > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > > > PropertyModel.
> > > > > > the attribute of my model is List and the wicket can't set the
> > > > > > drop-down model object to List.
> > > > > > what is your option to handle this?
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Sun, Sep 26, 2021 at 9:12 PM vahid ghasemi <va...@gmail.com>
wrote:

> So it's not any option to handle this issue?
> I have list but it's singleton list :(
>

You need to use ListMultipleChoice instead of DropDownChoice.


> On Sun, Sep 26, 2021, 6:17 PM Martin Terra <
> martin.terra@koodaripalvelut.com>
> wrote:
>
> > Choices model should be final and the selection model should be one item
> > not a list
> >
> >
> >
> > On Sun, Sep 26, 2021, 17:36 vahid ghasemi <va...@gmail.com>
> > wrote:
> >
> > > model class :
> > > class User {
> > > private List<SomeThing> someThing;
> > > }
> > >
> > > Page class :
> > > private User user;
> > > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > > PropertyModel(user,"someThing", ....);
> > >
> > > and this is my problem.
> > > how can I add the drop-down model to the user property which is list,
> > with
> > > PropertyModel
> > >
> > >
> > > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > > martin.terra@koodaripalvelut.com> wrote:
> > >
> > > > Hi!
> > > >
> > > > Can you paste some code with your exact (generic) variables which
> > doesn't
> > > > work, it might be easier to figure out from code example than verbal
> > > > description?
> > > >
> > > > **
> > > > Martin
> > > >
> > > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (
> vahidghasemi119@gmail.com)
> > > > kirjoitti:
> > > >
> > > > > Hello guys.
> > > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > > PropertyModel.
> > > > > the attribute of my model is List and the wicket can't set the
> > > > > drop-down model object to List.
> > > > > what is your option to handle this?
> > > > >
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by vahid ghasemi <va...@gmail.com>.
So it's not any option to handle this issue?
I have list but it's singleton list :(

On Sun, Sep 26, 2021, 6:17 PM Martin Terra <ma...@koodaripalvelut.com>
wrote:

> Choices model should be final and the selection model should be one item
> not a list
>
>
>
> On Sun, Sep 26, 2021, 17:36 vahid ghasemi <va...@gmail.com>
> wrote:
>
> > model class :
> > class User {
> > private List<SomeThing> someThing;
> > }
> >
> > Page class :
> > private User user;
> > Dropdown dd = new Dropdown("DropDownSomeThing", new
> > PropertyModel(user,"someThing", ....);
> >
> > and this is my problem.
> > how can I add the drop-down model to the user property which is list,
> with
> > PropertyModel
> >
> >
> > On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> > martin.terra@koodaripalvelut.com> wrote:
> >
> > > Hi!
> > >
> > > Can you paste some code with your exact (generic) variables which
> doesn't
> > > work, it might be easier to figure out from code example than verbal
> > > description?
> > >
> > > **
> > > Martin
> > >
> > > la 25. syysk. 2021 klo 19.46 vahid ghasemi (vahidghasemi119@gmail.com)
> > > kirjoitti:
> > >
> > > > Hello guys.
> > > > I have a dropdown and I want to use CompoundPropertyModel OR
> > > PropertyModel.
> > > > the attribute of my model is List and the wicket can't set the
> > > > drop-down model object to List.
> > > > what is your option to handle this?
> > > >
> > >
> >
>

Re: add Dropdown object to List

Posted by Martin Terra <ma...@koodaripalvelut.com>.
Choices model should be final and the selection model should be one item
not a list



On Sun, Sep 26, 2021, 17:36 vahid ghasemi <va...@gmail.com> wrote:

> model class :
> class User {
> private List<SomeThing> someThing;
> }
>
> Page class :
> private User user;
> Dropdown dd = new Dropdown("DropDownSomeThing", new
> PropertyModel(user,"someThing", ....);
>
> and this is my problem.
> how can I add the drop-down model to the user property which is list, with
> PropertyModel
>
>
> On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
> martin.terra@koodaripalvelut.com> wrote:
>
> > Hi!
> >
> > Can you paste some code with your exact (generic) variables which doesn't
> > work, it might be easier to figure out from code example than verbal
> > description?
> >
> > **
> > Martin
> >
> > la 25. syysk. 2021 klo 19.46 vahid ghasemi (vahidghasemi119@gmail.com)
> > kirjoitti:
> >
> > > Hello guys.
> > > I have a dropdown and I want to use CompoundPropertyModel OR
> > PropertyModel.
> > > the attribute of my model is List and the wicket can't set the
> > > drop-down model object to List.
> > > what is your option to handle this?
> > >
> >
>

Re: add Dropdown object to List

Posted by vahid ghasemi <va...@gmail.com>.
model class :
class User {
private List<SomeThing> someThing;
}

Page class :
private User user;
Dropdown dd = new Dropdown("DropDownSomeThing", new
PropertyModel(user,"someThing", ....);

and this is my problem.
how can I add the drop-down model to the user property which is list, with
PropertyModel


On Sun, Sep 26, 2021 at 7:31 AM Martin Terra <
martin.terra@koodaripalvelut.com> wrote:

> Hi!
>
> Can you paste some code with your exact (generic) variables which doesn't
> work, it might be easier to figure out from code example than verbal
> description?
>
> **
> Martin
>
> la 25. syysk. 2021 klo 19.46 vahid ghasemi (vahidghasemi119@gmail.com)
> kirjoitti:
>
> > Hello guys.
> > I have a dropdown and I want to use CompoundPropertyModel OR
> PropertyModel.
> > the attribute of my model is List and the wicket can't set the
> > drop-down model object to List.
> > what is your option to handle this?
> >
>

Re: add Dropdown object to List

Posted by Martin Terra <ma...@koodaripalvelut.com>.
Hi!

Can you paste some code with your exact (generic) variables which doesn't
work, it might be easier to figure out from code example than verbal
description?

**
Martin

la 25. syysk. 2021 klo 19.46 vahid ghasemi (vahidghasemi119@gmail.com)
kirjoitti:

> Hello guys.
> I have a dropdown and I want to use CompoundPropertyModel OR PropertyModel.
> the attribute of my model is List and the wicket can't set the
> drop-down model object to List.
> what is your option to handle this?
>