You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jnorris <j....@snet.net> on 2008/08/18 15:22:00 UTC

Problem getting value from DateTimeField

Hi All,

I have a couple of DateTimeField components on a form on a page that has a
Link that opens another page.  In the onClick() method for the Link I need
to get the values for the dates to put into a PageParameters object.  
However I can't seem to get the modified values for the dates.  I've tried
adding startdatefield.processInput() and startdatefield.validate().  In
either (or both) cases the value that is returned from the field in the
getModelObject() method is always the original date value, and the value
returned for getInput() is always "null, null:null".  OTOH in an onSubmit()
method for a Button on the form I can get the modified value as expected.  I
also tried form.process() but that didn't work either.  I don't want to do a
submit since other components may cause validation errors that don't mean
anything in this case.

I'm probably missing something obvious but I can't figure it out and I
didn't find anything helpful in searching this forum.  Any ideas on how to
get the date values without submitting the form would be appreciated.

Thanks,
Jim

-- 
View this message in context: http://www.nabble.com/Problem-getting-value-from-DateTimeField-tp19031215p19031215.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: Problem getting value from DateTimeField

Posted by jnorris <j....@snet.net>.
I was passing the dates (and some other fields) in parameters so they could
be restored when returning back to the page.  I just came across a different
technique for doing this in Wicket In Action (listing 6.7) so it is no
longer an issue for me.  Thanks WIA!  Great book - has helped me numerous
times.

Jim

-- 
View this message in context: http://www.nabble.com/Problem-getting-value-from-DateTimeField-tp19031215p19032604.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