If you need to disable the input text filed for adf:inputDate component then we can do that using any of the java scripts below.
1) This script will disable the key events on the text filed. Thus the user will not be able to edit the selected date using Keyboard.
<af:resource>
function disableEntry(evt){
evt.cancel();
}
</af:resource>
<af:inputDate label="Label 1" id="id1" readOnly="false"
contentStyle="background-color:lightgray;">
<af:clientListener method="disableEntry" type="keyDown"/> </af:inputDate>
2) This script will completely disable the text filed. The only problem with this script is that, if we have many input date components on a page, then we will need to apply this for all component by their IDs.
<af:document id="d1">
<f:facet name="metaContainer">
<f:verbatim>
<script type="text/javascript">
function disable(evt) {
document.getElementById('id1::content').disabled=true;
}
</script>
</f:verbatim>
</f:facet>
<af:clientListener method="disable()" type="load"/>
.....
<af:inputDate label="Date Picker" value="#{pageFlowScope.genPDF.dateEcheance}" binding="#{pageFlowScope.genPDF.id1}" id="id1"/>
1) This script will disable the key events on the text filed. Thus the user will not be able to edit the selected date using Keyboard.
<af:resource>
function disableEntry(evt){
evt.cancel();
}
</af:resource>
<af:inputDate label="Label 1" id="id1" readOnly="false"
contentStyle="background-color:lightgray;">
<af:clientListener method="disableEntry" type="keyDown"/> </af:inputDate>
2) This script will completely disable the text filed. The only problem with this script is that, if we have many input date components on a page, then we will need to apply this for all component by their IDs.
<af:document id="d1">
<f:facet name="metaContainer">
<f:verbatim>
<script type="text/javascript">
function disable(evt) {
document.getElementById('id1::content').disabled=true;
}
</script>
</f:verbatim>
</f:facet>
<af:clientListener method="disable()" type="load"/>
.....
<af:inputDate label="Date Picker" value="#{pageFlowScope.genPDF.dateEcheance}" binding="#{pageFlowScope.genPDF.id1}" id="id1"/>
No comments:
Post a Comment