Skip to main content

LOV enabled date field throws date format error !

While working with LOV enabled attribute date fields, you might have experienced some strange date format error on UI - "The date is not in the correct format". The reason for this error is well documented in developers guide, please refer topic 5.12.5 How to Handle Date Conversion for List Type UI Components in Fusion Developer's Guide.

In simple words, the underlying run time mechanism tries to copy the selected date from the LOV pop-up to the target field using the date format specified for the attribute. This may fail to do so if the format turns out to be null/invalid. Here, you are supposed to specify date format for LOV enabled 'date' attribute of the view object(using Control Hints editor for the attribute). Later, this 'pattern' would be used by af:convertDateTime to convert string into Date.

<af:inputListOfValues id="startDateId"
    popupTitle="Search and Select: #{bindings.StartDate.hints.label}"
    .........
    shortDesc="#{bindings.StartDate.hints.tooltip}">
<f:validator binding="#{bindings.StartDate.validator}"/>
<af:convertDateTime pattern="#{bindings.StartDate.format}"/>
</af:inputListOfValues>

Comments

Popular posts from this blog

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…