views:

488

answers:

1

I am using DateChooser in my project.In that after selecting some other date the dateChooser remains in same date(in current date).It is not changing visually.I tried with setData() and redraw() method's also.Still it is not working.I am using smartgwt-1.1 and gwt-1.6.4 version.My sample code is :

final DateChooser dateChooser = new DateChooser();
 dateChooser.setWidth("180");
 dateChooser.setHeight("180");

dateChooser.addDataChangedHandler(new DataChangedHandler() {
  public void onDataChanged(DataChangedEvent event) {
                            SC.say(dateChooser.getData()+"");
   dateChooser.setData(dateChooser.getData());
   dateChooser.redraw();
  }
 });

Can anyone give suggestion?

A: 

Where are you changing the date from code? I only see dateChooser.setData(dateChooser.getData()), and obviously that code's never going to change the data.

Matthew Flaschen
Then what to do to change the date? I am new to this area.Please post the code to change the date.
BlackPanther
What do you want to change it /to/?
Matthew Flaschen
It is not changing visually.It keep on stands in current Date.If we select some other date it wants to change visually(But it is not happening).If we try dateChooser.getData() it is giving selected date.But DateChooser still shows current date.Not changing to selected date.
BlackPanther
Please have a look at this link. http://forums.smartclient.com/showthread.php?p=23660#post23660
BlackPanther
The link has the same info you posted here, and an image I can't access because I'm not logged in. But again, I would /expect/ the code you have above to do nothing. You're setting the data to the data that's already there. What date do you want it to /change to/?
Matthew Flaschen
I am setting the date inside the addDataChangedHandler.I am not going to set any date using code.The above code gives the DatePicker in output.In the DatePicker we can select the date.When we select the date in DatePicker(in the output) onDataChanged(DataChangedEvent event) method will be executed.onDataChanged(DataChangedEvent event) method will not be executed on module load.After selecting any date from the DatePicker only it will execute.If u get free time please execute that code and check.Sign up process for the www.smartclient.com takes less time.Login and see image also.
BlackPanther