tags:

views:

472

answers:

3

I am evaluating whether to use SmartGWT, and have no prior experience with it. I have one particular question on the Calendar widget.

When you go to a airline/car rental website, and you need to specify the day of the month to make the booking, they pop up a month calendar which the customer-user could click forward/previous month to select the month. Then the customer-user selects the day of that month from the calendar.

In vaadin, you could constrain the calendar widget to do that.

Is there a way to define the behaviour and constrains of the calendar widget in SmargGWT to do that?

+1  A: 

There are many methods such as setDisableWeekends(Boolean disableWeekends) - events cannot be created on weekends, setTimelineRange(Date start, Date end) - sets the range over which the timeline will display events, setWorkdayStart(String workdayStart).

The javadoc shows just how much customization there is.

In a worst case scenario, if the Calendar class doesn't have some very specific functionality you can always subclass it.

If you need visual changes that will be most likely have to be made in CSS. I've inspected the generated HTML with firebug and it could be tedious, but 100% possible to alter the size of elements with CSS and the !important attribute to override inline styles.

Chris Tek
So far, the calendar created is too big. I need a tiny pop-up calendar. How to fix size of calendar to tiny and the days of month still clickable.
Blessed Geek
+1  A: 

I think you are looking for smartgwt DateChooser.I am using this in my application for similar case.

http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/widgets/DateChooser.html

BlackPanther
Yes, I just found that out too.
Blessed Geek
+1  A: 

Smartgwt user interfaces don't fail to impress. Tempted by an extensive set of slick looking widgets, I couldn't help but using it in a number of projects. There are a number of things to watch out for:

  1. Smartgwt is a GWT wrapper around a substantial Javascript library. You'll soon realize that to customize or alter a widget, or to fix an issue, you'll end up leaving Java and get engrossed in Javascript. You're not adopting a GWT framework, you're adopting a non-trivial Javascript framework. If you look at the Calendar showcase example, you'll soon realize that the customization options from within GWT are limited.

  2. Over time, encountered quite a number of serious cross-browser issues, mostly in less widely used browsers (Safari, Chrome). But, these less widely used browsers are gaining ground...

  3. Widgets and their data sources are tightly integrated, with Javascript under the hood. The data protocol used to power widgets from SOAP server resources broke twice between releases I adopted. And, you will end up trying new releases for the latest cross browser bug-fixes...Often, you'll want the latest snapshot. In both cases I was able to fix the issue, but it involved digging into the Javascript framework.

  4. In my experience, the adoption of smartgwt has turned out to be fairly high-maintenance. For some applications, you may be better off resisting the glitzy widgets and develop a simpler user interface using mostly GWT.

Having said all that, both smartgwt and smartclient are very well supported. The developer forums are extremely active and useful, issues get resolved quickly.

Hans