Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem in selection of date from calender widget to text box
Problem in selection of date from calender widget to text box [message #673265] Mon, 23 May 2011 04:16 Go to next message
marie Missing name is currently offline marie Missing nameFriend
Messages: 63
Registered: March 2011
Member
Hi all,
i am developing rap application.
I am facing problem in selecting of particular date

omposite container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(5, false);
container.setLayout(layout);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
final DateTime calendar = new DateTime (container, SWT.CALENDAR | SWT.BORDER);
final Label selectedDate = new Label(parent, SWT.NONE);
final DateFormat fmt = SimpleDateFormat.getDateInstance(DateFormat.LONG);
calendar.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {

String date=(calendar.getMonth () + 1) + "/" + (calendar.getDay ()) + "/" + (calendar.getYear ());
selectedDate.setText(date);
selectedDate.getParent().layout();
}
});
return selectedDate;
this is my code.i want to get date from this function to my text box like which we have in all web applications
(mena in clicking on calender button we get the calender and on seltion of praticular date it will come automatically in text box)
Please help me to resolve it.
I would appreciate any feedback.
thanks
Smile
Re: Problem in selection of date from calender widget to text box [message #673273 is a reply to message #673265] Mon, 23 May 2011 05:08 Go to previous messageGo to next message
Frank Appel is currently offline Frank AppelFriend
Messages: 46
Registered: July 2009
Member
Marie,

I'm sorry but I do not understand what your problem is. I've pasted your example code into a simple RWT standalone app and it worked as expected (see attached screenshot). Could you please elaborate a little bit on what you are trying to achieve? Note that I've tested this against CVS-Head, maybe you're using an older version?


Regards
Frank
Re: Problem in selection of date from calender widget to text box [message #673276 is a reply to message #673273] Mon, 23 May 2011 05:20 Go to previous messageGo to next message
marie Missing name is currently offline marie Missing nameFriend
Messages: 63
Registered: March 2011
Member
Hi Frank,
Thnks for your response.
I am trying to get this date in a text box.I want to put this date from this calender to my own textbox which is a different ui.I mean on selection of particular date from this calelnder it will go into the textbox.
Re: Problem in selection of date from calender widget to text box [message #673293 is a reply to message #673276] Mon, 23 May 2011 07:05 Go to previous messageGo to next message
Frank Appel is currently offline Frank AppelFriend
Messages: 46
Registered: July 2009
Member
Hi again,

I think you like to do something like shown in the attached screenshot (datepicker2.png). I've attached the class that implementes my screenshot example.

The idea is that you provide a simple date selection service that is registered by both - UI1 and UI2. UI1 contains the datepicker that actually triggers the service in case the date was changed by the user. UI2 listens to notifications and updates the textfield accordingly. Please have a look at the attached source file for more details.

In case you want to use this in the workbench and you have trouble to decide where to store the service: the simplest approach would be to store this in the session using the SessionSingletonBase#getInstance(Class) approach. Note the latter may have some downsides due to coupling reasons and there are more sophisticated solutions, but without knowing the exact purpose it's difficult to give a more appropriate advice.


Hope that helps
Frank
Re: Problem in selection of date from calender widget to text box [message #673641 is a reply to message #673293] Tue, 24 May 2011 10:09 Go to previous message
marie Missing name is currently offline marie Missing nameFriend
Messages: 63
Registered: March 2011
Member
Thanks for your reply frank.
Smile
Previous Topic:Integration of custom widgets in existing application
Next Topic:Selection Border Table Row
Goto Forum:
  


Current Time: Thu Apr 25 11:33:52 GMT 2024

Powered by FUDForum. Page generated in 0.02709 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top