Tuesday, February 11, 2014

Af InputDate Default Message hint - Disable

When we click on the af:InputDate , As soon as we click inside it, there is a default note hint which comes besides the inputDate field. Below is how it does.


So this works good for some implementations but sometimes client wants to avoid this default behaviour.
We had a requirement where client dsnt wanted this default hint note to be displayed on clicking the Input Date field.


We will see how we can remove this default behaviour.

First we will write a java script which will over ride the shouldShowHint function which is there in default implementation.




Once we are done with the Java Script, we need to use clientListener and use this JS.



We are done, now save and run the page. Below is the desired behaviour.




Great :)

Also just to add on this , we can customize the default behaviour.  Suppose if we want to add any custom message , we can use af:convertDateTime



Added custom message "This is custom message". So this will be shown in place of default message.


One can read more about af:convertDateTime at :- 
http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_convertDateTime.html

Thanks !!

7 comments:

  1. good post, interesting stuff. Thanks.

    ReplyDelete
  2. That's great, How can the calendar open when we click in the inputtext? thanks

    ReplyDelete
  3. Diego , I will post solution of ur use case tomorrow. I am sure I have done this !! Not in front of laptop right now. Thanks !!

    ReplyDelete
    Replies
    1. Thanks Rohan! I appreciate your effort!

      Delete
    2. any news on how to achieve that?

      Delete
    3. Hi Diego,

      Timo has answered this question. Have a look at this :

      https://community.oracle.com/thread/2355498?tstart=0

      Please let me know if it worked for you or u still have a problem

      Thanks
      Rohan

      Delete