Ok this is wicket-datetime if I'm not misstaken. 

You must override the newDateTextField then 


import java.util.Date; 

import org.apache.wicket.ajax.AjaxRequestTarget; 
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior; 
import org.apache.wicket.datetime.markup.html.form.DateTextField; 
import org.apache.wicket.extensions.yui.calendar.DateField; 
import org.apache.wicket.markup.html.WebPage; 
import org.apache.wicket.markup.html.form.Form; 
import org.apache.wicket.model.Model; 

/** 
 * Homepage 
 */ 
public class HomePage extends WebPage{ 

        private static final long serialVersionUID = 1L; 
         protected DateField dateField; 
    public HomePage() { 
    
    
          Form<Void> form = new Form<Void>( "form" ); 

           dateField = new DateField("date", new Model<Date>(new Date())){ 
            @Override 
            protected DateTextField newDateTextField(java.lang.String id,
org.apache.wicket.model.PropertyModel dateFieldModel){ 
            DateTextField f =  DateTextField.forShortStyle(id,
dateFieldModel); 
            f.add(new AjaxFormComponentUpdatingBehavior("onchange")  { 
    private static final long serialVersionUID = 1L; 

    @Override 
                   protected void onUpdate(AjaxRequestTarget arg0) { 
                       Date d = dateField.getModelObject(); 
                       System.out.println( d ); 
                   } 
                
               }); 
            return f; 
            } 
           }; 
    
          
            
           form.add( dateField ); 
           add( form ); 
            
    
    
    } 
    
    
    
  
} 
-- 
View this message in context: 
http://www.nabble.com/How-to-get-DateField-value-tp24567634p24575929.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to