1

I want to set an empty value for Alfresco Aikau DateTextBox widget. But the date is being set to "1970/1/1" automatically. How can i set a date to empty in Aikau ?
I'm trying this code in the jsonModel but it's not working:

{
   name:"alfresco/forms/controls/DateTextBox",
   widthPx:"90",
   config:{
      fieldId:"DATE_1",
      additionalCssClasses:"datefield",
      name:"Date1",
      value:"",
      requirementConfig:{
         initialValue:false
      }
   }
}
Younes Regaieg
  • 4,156
  • 2
  • 21
  • 37
soung
  • 1,411
  • 16
  • 33

2 Answers2

2

What version of Aikau are you using? We've made a number of changes to the alfresco/forms/controls/DateTextBox widget since it was first created. If the problem still persists in the latest version (which at the time of writing is v1.0.57) then you should raise a JIRA ticket or GitHub issue. There is a new release of Aikau each week and they are all backwards compatible so you should be able to take advantage of bugs fixes as soon as they are available. All bugs are prioritized ahead of features as the intention is that there should be no technical debt on the Aikau project. See this blog post for information on how to use new Aikau releases.

Dave Draper
  • 1,837
  • 11
  • 25
0

I am not sure regarding why it is not working with existing alfresco/forms/controls/DojoDateTextBox widget.I did following,for making it work.

1.I have created a new widget,Placed below content in the file.(This content is copied from existing widget)

define(["dojo/_base/declare",
        "alfresco/forms/controls/DateTextBox"],
        function(declare, DateTextBox) {
   return declare([DateTextBox], {});
});

2.Used that widget by using following.

    name : "js/Demo/MyCustomWidget",//It is the path of my custom widget.
    widthPx: "90",
    config : 
    {
       fieldId : "DATE_1",
       additionalCssClasses: "datefield",
       name : "Date1",
       value : undefined,//This must be undefined,neight null nor ""
       requirementConfig: 
       {
          initialValue: false
       }
   }

In case of aikau control,you can find source code inside tomcat\webapps\share\WEB-INF\lib\aikau-1.0.8.1.jar.Version of aikau jar file may differ depends on your alfresco version.

Krutik Jayswal
  • 3,165
  • 1
  • 15
  • 38