function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lochana RajputLochana Rajput 

ui:inputdDate not reflecting date after changing it

Hi,

I am iterating over a list of object and using HTML table. I have used ui:inputDate and it is not displaying the selected date.
In the backend, I am getting the changed date, but on UI still showing the previous date.
The same is happening with ui:inputText.

ui:inputDate working fine if not used with aura:iteration.
Best Answer chosen by Lochana Rajput
Lochana1 RajputLochana1 Rajput
After creating ui:inputDate component dynamically, it is not working with pagination. So while exploring other alternative solutions, I finally resolved issue by changing the structure of my wrapper class
I wanted to use Assessment Date field of contact.
So I changed wrapper class structure by adding separate field for Date as shown below:

Before
    public class TPSWrapper
    {
        @AuraEnabled
        public Contact objCon {get; set;}
        
        @AuraEnabled
        public String moduleName {get;set;}
       
        public TPSWrapper(Contact objTPS, String moduleName, Date assessmentDate){
            this.objTPS = objTPS;
            this.moduleName = moduleName;
            this.assessmentDate = assessmentDate;
        }
        
    }


After:
    public class TPSWrapper
    {
        @AuraEnabled
        public Contact objCon {get; set;}
        
        @AuraEnabled
        public String moduleName {get;set;}
        
        @AuraEnabled
        public Date assessmentDate{get;set;}
        
        public TPSWrapper(Contact objTPS, String moduleName, Date assessmentDate){
            this.objTPS = objTPS;
            this.moduleName = moduleName;
            this.assessmentDate = assessmentDate;
        }
        
    }

All Answers

Lochana RajputLochana Rajput
ui:inputDate does not work with wrapper class and I am using wrapper class. So what I did is created ui:inputDate componnet dynamically in helper and appended to parent where I wanted to display. That resolved my issue.
Lochana1 RajputLochana1 Rajput
After creating ui:inputDate component dynamically, it is not working with pagination. So while exploring other alternative solutions, I finally resolved issue by changing the structure of my wrapper class
I wanted to use Assessment Date field of contact.
So I changed wrapper class structure by adding separate field for Date as shown below:

Before
    public class TPSWrapper
    {
        @AuraEnabled
        public Contact objCon {get; set;}
        
        @AuraEnabled
        public String moduleName {get;set;}
       
        public TPSWrapper(Contact objTPS, String moduleName, Date assessmentDate){
            this.objTPS = objTPS;
            this.moduleName = moduleName;
            this.assessmentDate = assessmentDate;
        }
        
    }


After:
    public class TPSWrapper
    {
        @AuraEnabled
        public Contact objCon {get; set;}
        
        @AuraEnabled
        public String moduleName {get;set;}
        
        @AuraEnabled
        public Date assessmentDate{get;set;}
        
        public TPSWrapper(Contact objTPS, String moduleName, Date assessmentDate){
            this.objTPS = objTPS;
            this.moduleName = moduleName;
            this.assessmentDate = assessmentDate;
        }
        
    }
This was selected as the best answer