You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sam Hough <sa...@redspr.com> on 2007/08/17 13:29:23 UTC

"copy" from one IModel to another

I'd like to avoid using my real model for user input until it has been
validated (ie avoid putting bad values into the model, reduce interaction
with the middle tier)

Is there a nice Wicket way of doing this?

Maybe use CompoundPropertyModel that wraps another IModel that just stores
the values in a Map/Model but then be able to use the
CompoundPropertyModel's normal rules to apply the values to my real model?

Sorry if I've missed this documented elsewhere.

Cheers

Sam


-- 
View this message in context: http://www.nabble.com/%22copy%22-from-one-IModel-to-another-tf4285138.html#a12197951
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: how to change years in YUI datepicker ?

Posted by Maris Orbidans <sm...@ime.lv>.
it works, indeed
thanks
> On Dec 3, 2007 10:32 AM, Maris Orbidans <sm...@ime.lv> wrote:
>
>   
>> Hi
>>
>> I need a calendar that allows to change years quickly.   I have an input
>> field where user should enter his birth date.
>> But YUI calendar has buttons to change month only.  We can't ask our
>> users to click on those buttons hundred times to move calendar to their
>> birth date.
>> Is there any way to configure YUI calendar to have buttons that changes
>> year ?
>>     
>
>
> override DatePicker#enableMonthYearSelection and return true:
>
> class MyDatePicker extends DatePicker {
>   protected boolean enableMonthYearSelection() {
>     return true;
>   }
> }
>
> hth,
>   Gerolf
>
>
>   
>> And if not what should I do ?   It seems that other calendar (from
>> extensions)  is a lot better than this YUI crap but it has been removed
>> in 1.3.
>>
>> Maris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>     
>
>   

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


Re: how to change years in YUI datepicker ?

Posted by Gerolf Seitz <ge...@gmail.com>.
On Dec 3, 2007 10:32 AM, Maris Orbidans <sm...@ime.lv> wrote:

> Hi
>
> I need a calendar that allows to change years quickly.   I have an input
> field where user should enter his birth date.
> But YUI calendar has buttons to change month only.  We can't ask our
> users to click on those buttons hundred times to move calendar to their
> birth date.
> Is there any way to configure YUI calendar to have buttons that changes
> year ?


override DatePicker#enableMonthYearSelection and return true:

class MyDatePicker extends DatePicker {
  protected boolean enableMonthYearSelection() {
    return true;
  }
}

hth,
  Gerolf


>
>
> And if not what should I do ?   It seems that other calendar (from
> extensions)  is a lot better than this YUI crap but it has been removed
> in 1.3.
>
> Maris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

how to change years in YUI datepicker ?

Posted by Maris Orbidans <sm...@ime.lv>.
Hi

I need a calendar that allows to change years quickly.   I have an input 
field where user should enter his birth date. 
But YUI calendar has buttons to change month only.  We can't ask our 
users to click on those buttons hundred times to move calendar to their 
birth date.
Is there any way to configure YUI calendar to have buttons that changes 
year ?

And if not what should I do ?   It seems that other calendar (from 
extensions)  is a lot better than this YUI crap but it has been removed 
in 1.3.

Maris

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


Re: "copy" from one IModel to another

Posted by Sam Hough <sa...@redspr.com>.
Excellent. Looks like Wicket does away with my biggest reason to want to do
something silly like this.

Many thanks.


-- 
View this message in context: http://www.nabble.com/%22copy%22-from-one-IModel-to-another-tf4285138.html#a12201542
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: "copy" from one IModel to another

Posted by Maurice Marrink <ma...@gmail.com>.
The Form already does this, is there some other place you need to do this?
There is no other nice / wicket way to do this, so if you need this to
work when setting the value programatically i'm afraid you will have
to do some serious model coding yourself. and i don't think
compoundpropertymodel is going to be of much use for you in that case.

Take a look at Form.process() to see how form does this.

Maurice

On 8/17/07, Sam Hough <sa...@redspr.com> wrote:
>
> I'd like to avoid using my real model for user input until it has been
> validated (ie avoid putting bad values into the model, reduce interaction
> with the middle tier)
>
> Is there a nice Wicket way of doing this?
>
> Maybe use CompoundPropertyModel that wraps another IModel that just stores
> the values in a Map/Model but then be able to use the
> CompoundPropertyModel's normal rules to apply the values to my real model?
>
> Sorry if I've missed this documented elsewhere.
>
> Cheers
>
> Sam
>
>
> --
> View this message in context: http://www.nabble.com/%22copy%22-from-one-IModel-to-another-tf4285138.html#a12197951
> 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
>
>

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


Re: "copy" from one IModel to another

Posted by Igor Vaynberg <ig...@gmail.com>.
form model updates in wicket are atomic, so you wont get any bad values in
your model.

-igor


On 8/17/07, Sam Hough <sa...@redspr.com> wrote:
>
>
> I'd like to avoid using my real model for user input until it has been
> validated (ie avoid putting bad values into the model, reduce interaction
> with the middle tier)
>
> Is there a nice Wicket way of doing this?
>
> Maybe use CompoundPropertyModel that wraps another IModel that just stores
> the values in a Map/Model but then be able to use the
> CompoundPropertyModel's normal rules to apply the values to my real model?
>
> Sorry if I've missed this documented elsewhere.
>
> Cheers
>
> Sam
>
>
> --
> View this message in context:
> http://www.nabble.com/%22copy%22-from-one-IModel-to-another-tf4285138.html#a12197951
> 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
>
>