Forum Stats

  • 3,875,419 Users
  • 2,266,914 Discussions
  • 7,912,203 Comments

Discussions

inputDate - disabled the past dates

User_7TK0D
User_7TK0D Member Posts: 11 Green Ribbon

Hello,

I need some help.

I'm a newbie and I'm using JDeveloper 12.2.1.4.0. I have two inputDates.

From the first inputDate if I selected a date, the second inputDate should disabled the past dates from the first inputDate selected. How can I do that?

Expected output:

I selected a date in the first inputDate (For ex: Aug 5, 2022)

To the second inputDate, the highlighted should be disabled

Thank you.

Best Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,924 Red Diamond
    Answer ✓

    The af:inputdate component has a property named minValue. Set this value to the value of the first and it should work.

    Make sure you autosubmit the first value.


    Timo

  • dvohra21
    dvohra21 Member Posts: 14,692 Gold Crown
    Answer ✓

    autoSubmit - An attribute which if set to TRUE on a form element, the component will automatically submit when an appropriate action takes place (a click, text change, etc.). Since autoSubmit is a partial submit, also submitted and re-rendered are any other components with partialTriggers pointing to this component.

    partialTriggers - The IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too.

    As example:

    <af:inputDate label="To: " id="id1" ... autoSubmit="true"/>

    <af:inputDate label="From: " id="id2" ... partialTriggers="id1"/>

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,924 Red Diamond
    Answer ✓

    The af:inputdate component has a property named minValue. Set this value to the value of the first and it should work.

    Make sure you autosubmit the first value.


    Timo

  • dvohra21
    dvohra21 Member Posts: 14,692 Gold Crown

    Each date component is independent of the other by default. Either use a clientListener to create a dependency or derive value from the other with EL as Timo suggested.

  • User_7TK0D
    User_7TK0D Member Posts: 11 Green Ribbon

    Hello @Timo Hahn @dvohra21

    I already did what Timo suggested but I realized it is not working.

    This is what I did

    In personImportBean, I have a getter and setter of the startDate (data type is Date)

    Thank you.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,924 Red Diamond

    And what is not working?


    Timo

  • User_7TK0D
    User_7TK0D Member Posts: 11 Green Ribbon

    Hello @Timo Hahn

    The second inputDate not disabling the past dates that I selected in first inputDate.

    Thank you.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,924 Red Diamond

    Add a partialTrigger to the second input date pointing to the first. That should fix the problem.


    Timo

  • dvohra21
    dvohra21 Member Posts: 14,692 Gold Crown
    Answer ✓

    autoSubmit - An attribute which if set to TRUE on a form element, the component will automatically submit when an appropriate action takes place (a click, text change, etc.). Since autoSubmit is a partial submit, also submitted and re-rendered are any other components with partialTriggers pointing to this component.

    partialTriggers - The IDs of the components that should trigger a partial update. This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too.

    As example:

    <af:inputDate label="To: " id="id1" ... autoSubmit="true"/>

    <af:inputDate label="From: " id="id2" ... partialTriggers="id1"/>