t) Verify that commonly used functionality works. In this case its required,
dateFormatPattern, maxDate, minDate, and selectedDate. E6293871
i) Test steps:
- Drag a basic > button onto designer and label it submit
- Drag a basic > message onto designer
- Drag a basic > label onto designer and label it: Please select your birthdate.
- Drag a basic > calendar onto designer.
- Link the message component to the calendar
It should update to say: Message summary for calendar 1
- Link the label component to the calendar
- Go to the Outline pane. Right click SessionBean1 and select Add > Property
- Set the Name = maxDate and the type to java.util.Date, press OK
- Go to the Outline pane. Right click SessionBean1 and select Add > Property
- Set the Name = minDate and the type to java.util.Date, press OK
- Go to the Outline pane. Right click SessionBean1 and select Add > Property
- Set the Name = selectedDate and the type to java.util.Date, press OK
- Select Calendar on the designer and go to its properties.
- Go to dateFormatPattern property and press the ...
- Check-on the MM.dd.yyy format and press OK.
- Go to the maxDate property and press the ...
Select the #{SessionBean1.maxDate} and press OK.
- Go to the minDate property and press the ...
Select the #{SessionBean1.minDate} and press OK.
- Go to the Required property and set it to true
The label should show the * indicator
- Go to the selectedDate property and press the ...
Select the #{SessionBean1.selectedDate} and press OK.
- Select the Java tab of the designer and add the following import statement:
import java.util.Date;
- 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));
- Ctrl-S to save
- Go back to designer
- Deploy/run the application
o) expected results
- Label component should have a * indicator
- Calendar should appear with the default date of 08.13.1969
- Calendar help (under calendar) should show mm.dd.yyyy
- Opening the calendar should show it positioned on the date 08.13.1969
- Year dropdown range should be from 1901 to this current year
- Selection of a date (ie, 03.16.1955) should close the calendar and populate
the calendar text field.
- Pressing the submit button should render no errors.
- emptying the selected date and pressing the button should show: Validation
Error: value is requried and the lable should get bolded in red.