English 中文(简体)
SmartGWT calendar month widget
原标题:

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?

最佳回答

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

问题回答

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.

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.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签