Michael, it's been a while since I messed with this.
I exposed a mini-calendar to users with the day of week in the format.
I don't have access to the application anymore - I thought JSF enforced
valid dates for me when I tested it out, if user typed over the calendar
picker selection.
Here's the generated jsp
<hx:columnEx id="columnEx6">
<f:facet name="header">
<h:outputText styleClass="headerClass1" value="Planned Return Date" id="text8"
style="border-style: none"></h:outputText>
</f:facet>
<h:inputText styleClass="inputText_DatePicker" id="text9"
value="#{varPendingMachineLoanerOrders.PresentationDateFormat}"
binding="#{BudgetApproval.PendingMachineLoanerOrders_PresentationDateFormat_Ref}" required="true">
<hx:convertDateTime type="date" pattern="EEE, MMM d, yyyy" /> <hx:inputHelperDatePicker id="datePicker1" />
</h:inputText>
</hx:columnEx>
I wanted to use a <hx:validateDateTimeRange> tag in my table for this
date column, but RBD 7.1 (or JSF) had some sort of bug with date range
validation within a table with a pager.
That would have let me impose a dynamic minimum and maximum date for
each row in my table, but didn't work - I think the minimum/maximum
range had to apply to ALL rows in table.
I ended up validating valid date range in my EGL code.
In your case, if they used a 2 character year and you had
minimum/maximum year set to 1900 and 2200 (for example), maybe JSF would
flag that error.
In my EGL record:
dataItem PresentationDateFormat DATE {persistent = no, dateFormat =
"EEE, MMM d, yyyy"} end
This is how I interfaced from JSF to EGL - within EGL code, I would
assign to another date format dataitem (ISO) for interfacing with SQL
and date comparisons:
dataItem NORDPLNRTN DATE {dateFormat = isoDateFormat}
{column="LIBX.FILEX.NORDPLNRTN"} end
***************************************************************************************************************************
Is there a function in EGL that will edit for a valid date? I have users who are stubborn and don't like to use the calendar helper button, and would rather key in their own dates. This causes problems especially when the application expects a date in MM/dd/yyyy format and they key MM/dd/yy. Need to edit to make sure the date is valid and in the correct format.
Michael Soucy
As an Amazon Associate we earn from qualifying purchases.