[OutSystems UI] DatePicker 2.9.0 - InitialDate after is not possible change the date
outsystems-ui
Reactive icon
Forge component by Platform Maintenance
Application Type
Reactive

Hello,

In DatePicker 2.9.0 if I put InitialDate same variable as I have in Input it appears well but if I change date on DatePicker the input blink and the date disappears. Some workaround for that?

Thanks, Paulo Torres

Hi @Paulo Torres 

First of all thank you for reaching out.
Could you please provide a sample with that scenario being replicated so that we can try to take a look?
Thank you in advance.

Cheers,
GM

Thanks for quick answer @Gonçalo Martins ,

I'll prepare a eSpace and send.

Regards

I was facing the same issue and I implemented a fix that might help you in the short run, but it would be nice to have this fixed.

Following this link, you can see that the DatePicker with the fix applied (on left) is showing the date that was present in the database and the date picker on the right is not.

https://joao-franco.outsystemscloud.com/DatePickerCodeSharing/StudentDetails?StudentId=1

Hope this will help

DatePickerCodeSharing.oml

Hi @Paulo Torres 

Thank you for sharing.
That is not actually a real issue, it only has to do about the component's lifecycle (we're working on a way to make this frictionless).

Since you're binding a value that comes from an Aggregate (Get From others Sources would be the same) you need to make sure that the data was already fetched from the server so that our javascript component and the provider's instance can be properly instantiated.

To solve that and, as a common best practice, you only need to enclose the component on an IF statement looking at the IsDataFetched property:

I also attached a sample.

Hope it helps.

Cheers,
GM






DatePickerCodeSharing.oml

Hi @Gonçalo Martins 

I'm not affiliated with @Paulo Torres, so he might be facing a slightly different issue. I just answered here because it seems the same problem that I encounter when I was implementing a how-to.

Having said this, if you follow the link that I share and check the espace attached you will see that didn't fix the issue. I did tryed it  while ago and because it didn't work, I removed it, although I agree with you that I should have wrapped the widget on that if.

Cheers

DatePickerCodeSharing.oml

Hi @João Franco 

Could you be more specific?
I just installed your module and everything seems to be working fine.
You didn't fill in the InitialDate OptionalConfig nor the TimeFormat (if the attribute is date-time you can't have time format disabled ) so that's the reason you're not getting that value, but once I filled it in it works, so everything seems to be working as expected with the suggestion I made.
Also, check if the Aggregate is returning values, just in case 😅

Hi @Gonçalo Martins,

I can confirm that, after filling in the InitialDate with the IF for waiting for the data to be fetched, it did the trick. I though I already tested it like this, but I've must done something wrong. 

This was just a test module, that's why there isn't any validation of that sort, because I was trying just to make that work so I could implement it in the main application correctly.

Thanks for the help.


Hi @Paulo Torres  

If you could confirm if it's working fine, please mark this thread as solved so that other community members with similar issues can find this.

Cheers,
GM

Hello @Gonçalo Martins ,

First of all thanks for your answers and thanks also @João Franco to try to help.

In fact my situation is different that João has and today I discovered the reason. I'm not passing a Date from Database to DatePicker, I have a variable in screen and I use this one on InitialDate but also I put in MaxDate CurrDate() and the bug appears when we put MaxDate.

Bug: When you try to change Date the Date selected not appears and DatePicker blinks.

I attached a sample.


Sandbox_PTorres.oml


Hi @Paulo Torres  

Starting today I’m OOO but I already pass this topic to my team so that they can try to help.

Cheers,
GM

HI @Paulo Torres,

From what I gathered, you're missing a default value on that Date. After I added a CurrDate(), its working as expected.


Best Regards,

Bernardo Cardoso

Hello @Bernardo Cardoso ,

My Case:

- I have a structure and even if I put default value currDateTime() if I put MaxDate = currDateTime() I can't change the date, component blinks and nothing happens.

For now this working but I can't use the MaxDate parameter.

Thanks

I believe those parameters are Date type now, maybe that's the root cause?

Sorry, nevermind, I thought this was the DatePickerRange, which uses Date type.

Let me try to replicate that and have a closer look.

I tested using the oml you shared, and it seems to be working fine (attached below).

But if you say you're using a structure, then those dates come from some dynamic data. Doesn't adding an If around the DatePicker with the IsDataFetched, solves the issue?


Sandbox_PTorres.oml

Hi @Paulo Torres

Any update on this topic?
Any finding you can share or anything that we could try to help with?

Best Regards,
GM

Hello @Gonçalo Martins ,

Sorry for the delay.

I solved my problems with if IsDataFetched, it's a workaround in my opinion but at least works.

Thanks for the support

I have another question... It's not possible to have a InitialDate but not showing, I mean the input it's empty but when you click widget appears with this InitialDate.

Thanks

Could you please explain that use case with more information since I didn't get the point?
You want to have an Initial value without showing it? What do you mean by showing when clicking on the widget (what would be the trigger)? With the client action to update the initial date aren't you able to do something like that?

Hello @Gonçalo Martins ,

If I put this

It works:

My question is: Some workaround to have this date when I open the calendar but not show on input if the parameter is Null?

Thanks

You seem to be using the DEPRECATED_DatePicker am I correct?


Hello Gonçalo,

No, I'm using the current one.

Thanks

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.