Tuesday 15 December 2015

ADF: Disabling Input Field for Date Component af:inputDate

Hello all,

This post is a basic post regarding a scenario in which we had to provide a date component and disable the inputField in af:inputDate component.

There are many ways to implement this scenario, this is one of those.
For the the demonstration, I have created a TemporaryVO and create a transient attribute with Timestamp dataType.

For the an implementation just drag the attribute and drop it as ADF input Date.


Surround the component with a af:panelLableWithMessage and then put an af:inputText component from the components section.

Then set the disable property of the inputText to true.
And then copy the value of the inputDate and paste it in the value of the input field.
Here is the xml code .

<af:panelLabelAndMessage label="New Date" id="plam1">
                        <af:panelGroupLayout id="pgl1" layout="horizontal">
                            <af:inputText label="Label 1" id="it1" simple="true" disabled="true"
                                          value="#{bindings.NewDateTrans.inputValue}"/>
                            <af:inputDate value="#{bindings.NewDateTrans.inputValue}"
                                          required="#{bindings.NewDateTrans.hints.mandatory}"
                                          columns="#{bindings.NewDateTrans.hints.displayWidth}"
                                          shortDesc="#{bindings.NewDateTrans.hints.tooltip}" id="id1" autoSubmit="true" simple="true"
                                          contentStyle="display:none;">
                                <f:validator binding="#{bindings.NewDateTrans.validator}"/>
                                <af:convertDateTime pattern="#{bindings.NewDateTrans.format}"/>
                            </af:inputDate>
                        </af:panelGroupLayout>
                    </af:panelLabelAndMessage>



That's it. Now run the application.

Here is the Sample Application for Reference : DateFieldTestApp

1 comment:

  1. http://adfjavacodes.blogspot.in/2015/12/adf-disabling-input-field-for-date.html

    ReplyDelete