Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Add calendar icon to input text

susanlinJun 29 2015 — edited Jun 30 2015

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.

Comments

Ruben Rodriguez

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

dvohra21

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

User

Go with what @"Ruben Rodriguez" suggested

Ashish

1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 28 2015
Added on Jun 29 2015
3 comments
1,343 views