someone asked the same question and i gave him a few hints here http://groups.google.com/group/google-web-toolkit/browse_thread/thread/aaddc977214053bd/f5c90611cb424ac7 hope you'll get something out of it
good luck On Feb 25, 1:19 pm, Ice13ill <[email protected]> wrote: > At least tell me if i'm posting the wrong questions :P > > On Feb 24, 4:47 pm, Ice13ill <[email protected]> wrote: > > > I tried using formatting but i can't disable the cells of theDatePicker > > > I just want to disable all dates before a given date. how do i do > > that ? > > > On Jan 20, 6:54 pm, Jim Douglas <[email protected]> wrote: > > > > If you're using a DateBox, you can define a custom Format with your > > > own parsing rules with: > > > > setFormat(new CustomDateFormat(DateTimeFormat.getFormat > > > (pattern))); > > > >http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/g...) > > > > private static final String DATE_BOX_FORMAT_ERROR = > > > "dateBoxFormatError"; > > > > private class CustomDateFormat extends DateBox.DefaultFormat > > > { > > > public CustomDateFormat(DateTimeFormat dateTimeFormat) > > > { > > > super(dateTimeFormat); > > > } > > > > @Override > > > public Date parse(DateBox dateBox, String dateText, boolean > > > reportError) > > > { > > > Date date = null; > > > try > > > { > > > if (dateText.length() > 0) > > > { > > > date = getDateTimeFormat().parseStrict(dateText); > > > } > > > } > > > catch (Exception exception) > > > { > > > // According to the documentation, this should be an > > > // IllegalArgumentException, but bugs in > > > DateTimeFormat > > > // can cause other exceptions to be thrown, for > > > example: > > > // java.lang.StringIndexOutOfBoundsException: String > > > index out of range: 0 > > > // at java.lang.String.charAt(String.java:558) > > > // at > > > com.google.gwt.i18n.client.DateTimeFormat.parseInt(DateTimeFormat.java: > > > 1415) > > > } > > > if (date == null) > > > { > > > // If there are other formats you want to support, do > > > the parsing here > > > } > > > if (date != null) > > > { > > > // If there aredatesthat you want to disallow, set > > > date to null here > > > } > > > if (date == null && reportError) > > > { > > > dateBox.addStyleName(DATE_BOX_FORMAT_ERROR); > > > } > > > return date; > > > } > > > } > > > > On Jan 19, 8:02 am, Mark Davis <[email protected]> wrote: > > > > > Hi, > > > > > I need todisablespecifieddatesinDatePicker. > > > > > What is the best way to do it? > > > > > thanks in advance, > > > > Mark > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
