Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    dateitem to show only year

    smartgwt2.5.1
    firefoxv3.6

    Hi,
    I want to display only year.using setAttribute("selectorFormat", "Y") i achieved that.The selectitem of year defaulty show the current year.i select '2010' in the form after i click my submit button it's displayed the current year.it's not changing to the year which i selected.

    final DateItem fiscaleYr = new DateItem ("fiscaleYr",constants.fiscaleYr());
    fiscaleYr.setWrapTitle(false);
    fiscaleYr.setRequired(false);
    fiscaleYr.setWidth(200);
    fiscaleYr.setTitleAlign(Alignment.LEFT);
    fiscaleYr.setDisabled(true);
    fiscaleYr.setTitleStyle("fiscalend");
    fiscaleYr.setAttribute("selectorFormat", "Y");
    fiscaleYr.setShowFocused(false);

    #2
    I haved the same problem and fixed something like this:
    Code:
    SelectItem select =  fiscaleYr.getYearSelector();
    		String nn = select.getValueAsString();
    	        System.out.println("Year" + nn);

    Comment

    Working...
    X