Forum Stats

  • 3,770,516 Users
  • 2,253,129 Discussions
  • 7,875,493 Comments

Discussions

Add calendar icon to input text

susanlin
susanlin Member Posts: 116
edited Jun 30, 2015 1:56AM in JDeveloper and ADF

Is it possible to add the calendar chooser to a normal input text box? I ask because I need a textbox which can insert words or a date so the inputDate component will not work for me, but I need to have a calendar icon to allow the user to select a date.

Tagged:
Ashish AwasthiHabib Eslami

Answers

  • Ruben Rodriguez
    Ruben Rodriguez Member Posts: 351 Gold Badge
    edited Jun 29, 2015 3:33PM

    Hello,

    You can add an inputText and an inputDate.

    <af:panelLabelAndMessage label="Label 1" id="plam1">

         <af:inputText simple="true" id="it1" partialTriggers="id1">

         <af:inputDate label="Label 1" simple="true" id="id1" autoSubmit="true" styleClass="myClass"

                                valueChangeListener="#{testBean.valueChangeInputDate}"/>

    </af:panelLabelAndMessage>

    Then hide inputDate label using simple="true" and content in the skin:

    af|inputDate.myClass::content{

        display:none;

    }

    you have to pass the value to the inputtext and you can do it in the valueChangeListener.

        public void valueChangeDate(ValueChangeEvent valueChangeEvent) {

            Object o = valueChangeEvent.getNewValue();

            RichInputText rit = (RichInputText)findComponentInRoot("it1");

            rit.setValue(o);

        }

    regards,

    Ruben

    Ashish AwasthiHabib Eslami
  • dvohra21
    dvohra21 Member Posts: 14,258 Gold Crown
    edited Jun 30, 2015 12:08AM

    I need a textbox which can insert words or a date

    In af:inputDate words or a date may be specified without selecting a date from the calendar popup.

  • Ashish Awasthi
    Ashish Awasthi Member Posts: 3,388 Bronze Crown
    edited Jun 30, 2015 1:56AM

    User

    Go with what @Ruben Rodriguez suggested

    Ashish

This discussion has been closed.