t) Verify that commonly used functionality works. In this case its required, dateFormatPattern, maxDate, minDate, and selectedDate. E6293871

i) Test steps:

  1. Drag a basic > button onto designer and label it submit
  2. Drag a basic > message onto designer
  3. Drag a basic > label onto designer and label it: Please select your birthdate.
  4. Drag a basic > calendar onto designer.
  5. Link the message component to the calendar
    It should update to say: Message summary for calendar 1
  6. Link the label component to the calendar
  7. Go to the Outline pane. Right click SessionBean1 and select Add > Property
  8. Set the Name = maxDate and the type to java.util.Date, press OK
  9. Go to the Outline pane. Right click SessionBean1 and select Add > Property
  10. Set the Name = minDate and the type to java.util.Date, press OK
  11. Go to the Outline pane. Right click SessionBean1 and select Add > Property
  12. Set the Name = selectedDate and the type to java.util.Date, press OK
  13. Select Calendar on the designer and go to its properties.
  14. Go to dateFormatPattern property and press the ...
  15. Check-on the MM.dd.yyy format and press OK.
  16. Go to the maxDate property and press the ...
    Select the #{SessionBean1.maxDate} and press OK.
  17. Go to the minDate property and press the ...
    Select the #{SessionBean1.minDate} and press OK.
  18. Go to the Required property and set it to true
    The label should show the * indicator
  19. Go to the selectedDate property and press the ...
    Select the #{SessionBean1.selectedDate} and press OK.
  20. Select the Java tab of the designer and add the following import statement:
    import java.util.Date;
  21. Scroll down to the init() method and add the following code:
    getSessionBean1().setMaxDate(new Date());
    getSessionBean1().setMinDate(new Date(01, 0, 1));
    getSessionBean1().setSelectedDate(new Date(69, 7, 13));
  22. Ctrl-S to save
  23. Go back to designer
  24. Deploy/run the application

o) expected results

  1. Label component should have a * indicator
  2. Calendar should appear with the default date of 08.13.1969
  3. Calendar help (under calendar) should show mm.dd.yyyy
  4. Opening the calendar should show it positioned on the date 08.13.1969
  5. Year dropdown range should be from 1901 to this current year
  6. Selection of a date (ie, 03.16.1955) should close the calendar and populate the calendar text field.
  7. Pressing the submit button should render no errors.
  8. emptying the selected date and pressing the button should show: Validation Error: value is requried and the lable should get bolded in red.