You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jensiator <je...@megasol.se> on 2008/11/03 11:40:25 UTC

DropDownChoices where Model is different from Data

Hi. 
I have a form model containing a idKey that is supposed to be selected from
a dropdownchoice. Does anyone know if its possible have a complex data type
in the dropdownchoice when the model is only a idKey? The dropdownchoice
wants to set the complex data type in the form model. 
For example in a dropdownconstructor:
public MyDropDown(String pId,PropertyModel<UUID> pModel){
super(pId,new LoadableDetachableModel<MyClass>(){

       protected List<MyClass> load() 
       {
           return requestClasses();
       }

})
setChoiceRenderer(new ChoiceRenderer<Myclass>("displayName", "idKey"));

would It be possible to link the pModel in another model (SpecialModel) to
accomplish this? Like: setModel(new SpecialModel(pModel));

-- 
View this message in context: http://www.nabble.com/DropDownChoices-where-Model-is-different-from-Data-tp20300450p20300450.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: DropDownChoices where Model is different from Data

Posted by jensiator <je...@megasol.se>.
Tanks Nino. Just checking if I was out in the blue. I'll try to do something
with my chained model. 
Jens


Nino.Martinez wrote:
> 
> Hi
> 
> since it's java development, the only limit are your mind (now all your 
> ruby guys dont hit me).. As you write yourself just create a 
> choicerenderer, then choicerenderer itself can decide howto display data..
> 
> And yes if you chain stuff and implement your own model etc you can do 
> it all your own way..
> 
> jensiator wrote:
>> Hi. 
>> I have a form model containing a idKey that is supposed to be selected
>> from
>> a dropdownchoice. Does anyone know if its possible have a complex data
>> type
>> in the dropdownchoice when the model is only a idKey? The dropdownchoice
>> wants to set the complex data type in the form model. 
>> For example in a dropdownconstructor:
>> public MyDropDown(String pId,PropertyModel<UUID> pModel){
>> super(pId,new LoadableDetachableModel<MyClass>(){
>>
>>        protected List<MyClass> load() 
>>        {
>>            return requestClasses();
>>        }
>>
>> })
>> setChoiceRenderer(new ChoiceRenderer<Myclass>("displayName", "idKey"));
>>
>> would It be possible to link the pModel in another model (SpecialModel)
>> to
>> accomplish this? Like: setModel(new SpecialModel(pModel));
>>
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/DropDownChoices-where-Model-is-different-from-Data-tp20300450p20301347.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: DropDownChoices where Model is different from Data

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Hi

since it's java development, the only limit are your mind (now all your 
ruby guys dont hit me).. As you write yourself just create a 
choicerenderer, then choicerenderer itself can decide howto display data..

And yes if you chain stuff and implement your own model etc you can do 
it all your own way..

jensiator wrote:
> Hi. 
> I have a form model containing a idKey that is supposed to be selected from
> a dropdownchoice. Does anyone know if its possible have a complex data type
> in the dropdownchoice when the model is only a idKey? The dropdownchoice
> wants to set the complex data type in the form model. 
> For example in a dropdownconstructor:
> public MyDropDown(String pId,PropertyModel<UUID> pModel){
> super(pId,new LoadableDetachableModel<MyClass>(){
>
>        protected List<MyClass> load() 
>        {
>            return requestClasses();
>        }
>
> })
> setChoiceRenderer(new ChoiceRenderer<Myclass>("displayName", "idKey"));
>
> would It be possible to link the pModel in another model (SpecialModel) to
> accomplish this? Like: setModel(new SpecialModel(pModel));
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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