cancel
Showing results for 
Search instead for 
Did you mean: 

Date Validation in Aikau widget

anshu_kumar
Star Contributor
Star Contributor
Hello Guys,

I have a very basic requirement for which I am using Aikau widgets to develop.
The requirement is to have a form based selection of 'FROM' and 'To' dates. I am able to populate the Date textbox using "alfresco/forms/controls/DateTextBox" widget. However, I need to put a validation in which 'from' date should always be less than 'to'. Can someone help me achieve this. Thanks. Below is the piece of code that shows the dates selection.

<javascript>
var date = new Date();
var todayDate = date.toISOString();

model.jsonModel = {
   
    widgets: [
   {
      id: "FROM_DATE",
      name: "alfresco/forms/controls/DateTextBox",
      config:   {
         label: "FROM",
         name: "fromDate",
         value: todayDate
      }
    },
   {
      id: "TO_DATE",
      name: "alfresco/forms/controls/DateTextBox",
      config:   {
         label: "TO",
         name: "toDate",
         value: todayDate
      }
    }   
]};
</javascript>
28 REPLIES 28

Thanks. I look at all this

Thanks Dave Draper​ but I think this is a serious problem because my paginator get the documents when i click on button forward and load in my page and reload again. I don't understand.

The example do not meet my needs

ddraper
World-Class Innovator
World-Class Innovator

If you think that this is a bug then you can raise an issue on the GitHub repository, however we'll need a testable use case... this means that we'll need examples of the JSON responses returned from your custom API for both the initial page load and then request for the next page. We'll also need the page model that you're using as well as any custom source that may be relevant. We fix bugs by reproducing the error conditions in our unit test application and adding tests to prevent further regressions. We won't be able to fix anything without this information.

ddraper
World-Class Innovator
World-Class Innovator

Can you describe an example that would meet your needs?

Yo Dave Draper​ . Everything work perfectly now.  THANKS FOR ALL.

I'll back to give some example to explain how use AlfFilterList et paginator the all with webscript (service) for beginner.

I'm very happy

tansadio
Confirmed Champ
Confirmed Champ

I don't have a difficult to get value widget TextBox and Select with Dojo module dom or query. But Impossible to make same way with DateTextBox.

I have test with Dojo DatetextBox and that works perfectly.

ddraper
World-Class Innovator
World-Class Innovator

The reason for it not working with the DateTextBox is because of where the data is stored in the widget - as opposed to in the DOM with those other widgets.

tansadio
Confirmed Champ
Confirmed Champ

Hey Dave Draper

Smiley Happy I'm coming to get value Widget DateTextBox. Thanks for your help.