2 Replies Latest reply on Sep 15, 2011 6:28 PM by 863849

    af:inputDate on focus/cursor

    863849
      Hi,
      I need to display date picker (glyph) when cursor is placed in the af:inputdate. I appreciate if someone can help me...


      <af:inputDate label="Dates:" id="it2" clientComponent="true">
      <af:resource type="javascript">
      function toReadOnlyMode(event) {
      var component = evt.getSource();
      var glyph = component.getPeer()._getGlyph(event.getSource());
      glyph.focus();
      }
      </af:resource>
      <af:clientListener method="toReadOnlyMode" type="focus"/>
      </af:inputDate>

      Thanks
      Krishna
        • 1. Re: af:inputDate on focus/cursor
          Frank Nimphius-Oracle
          Hi,

          don't code against internal APIs, which is what you do by accessing peer objects and methods that start with an underline.

          This post here has some proper JS to do the job

          http://blogs.oracle.com/jdevotnharvest/entry/how_to_launch_lov_and_date_dialogs_using_the_keyboard

          Frank
          • 2. Re: af:inputDate on focus/cursor
            863849
            Thanks for the link and the final solution is


            <af:resource type="javascript">
            function showDatePopup(evt) {
            var afRichInputDate = evt.getSource(); // oracle.adf.RichInputDate
            var popup = afRichInputDate.getPeer()._getPopup(afRichInputDate); // oracle.adf.RichPopup
            var hints = {};
            hints[AdfRichPopup.HINT_ALIGN_ID] = afRichInputDate.getClientId();
            hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_AFTER_START;
            popup.show(hints);
            //alert(popup);
            }
            </af:resource>

            <af:inputDate label="Dates:" id="it2" clientComponent="true">
            <af:convertDateTime pattern="dd-MM-yyyy 00:00:00"/>
            <af:clientListener method="showDatePopup" type="focus"/>
            </af:inputDate>