Default to Empty Controls\Calendar 

Default to Empty Controls\Calendar 

  

Hi,

I am facing strange issue.

I am using Controls\Calendar webblock for input box. I didn't specified initial data.

By default i am getting current date. I want to display blank for that text box. 

Can anyone help me in resolving this issue?







Hi Sekar,

This indeed looks like a bug. Whe nyo set everything to NullDate(), the fields is still loaded as current date.

Maybe OutSystems can help out in this case.

Kind regards,

Remco Dekkinga

Hi Remco,

Thanks for the reply, 

I am planning to clear textbox value in jQuery document ready

Do you have any alternate solution to fix this?

If i use RichWidgets calendar blank is working fine. But that one doesn't come with my theme. so i don't want use that.



Hi Sekar,

I don't have a ready to use solution for you. I've forwarded your question to OutSystems and hopefully they will answer your question here soon.

Kind regards,

Remco Dekkinga


Hey Sekar,

Do you have the most recent version of Silk Web? Directly from the last release notes :)

  • "Added the feature of having a blank Calendar input until a date is selected and of clearing Calendar input values after selection.
    • To use this feature, select the Input Text associated with the Calendar and add the Extended Property data-blank-field with the value True."

Right now, if I'm not mistaken, it will show you what you have on placeholder. So, for example, if you have DD/MM/YYYY in your server, it will show you that instead of the current date. 

Hope this helps and let me know if it doesn't!

Solution

Got response from Out system support

we need to set data-blank-field = True in calendar input box extend properties

Solution

Rita Dias wrote:

Hey Sekar,

Do you have the most recent version of Silk Web? Directly from the last release notes :)

  • "Added the feature of having a blank Calendar input until a date is selected and of clearing Calendar input values after selection.
    • To use this feature, select the Input Text associated with the Calendar and add the Extended Property data-blank-field with the value True."

Right now, if I'm not mistaken, it will show you what you have on placeholder. So, for example, if you have DD/MM/YYYY in your server, it will show you that instead of the current date. 

Hope this helps and let me know if it doesn't!

Hi Rita,

I found a bug using this extended property.

So, if I set my input with data-blank-field = 'True', when the input is disabled, the text inside it is shown correctly. But if the input is enabled, the text shown is empty.

Can you help me in this case?


Best Regards,

Nelson Pinto


My workaround for this was to use the Calendar found in Richwidgets instead.

Claring wrote:

My workaround for this was to use the Calendar found in Richwidgets instead.

Hi Claring,

Thanks for your reply, but I want to use the WebPatterns Calendar.

So, I need a workaround for that problem.


Regards,

Nelson


After some hours investigation, I found the problem.

The Outsystems commented the line self.hide() in this peace of code:


self._onInputBlur = function()
        {
            // IE allows pika div to gain focus; catch blur the input field
            var pEl = document.activeElement;
            do {
                if (hasClass(pEl, 'pika-single')) {
                    return;
                }
            }
            while ((pEl = pEl.parentNode));

            if (opts.autoClose && !self._c) {
                self._b = sto(function() {
                    //self.hide();
                }, 50);
            }
            self._c = false;
        };


Uncommented this line, solves the problem. Despite of that, I don't know why it was commented firstly, because the official code in https://github.com/dbushell/Pikaday, this don't happen. 

Hey npinto!

data-blank-field, sets not only the initial value of the input as blank but also allows you to erase the date that you had on the input. This was part of the decisions that we made when we were developing it, so as of right now there's no way to separate the two. I'm not sure how that commented line would correct it but it's good to see that you have found a work around, we'll keep this in mind for the future.


Thanks for the feedback!

Rita


Rita Dias wrote:

Hey npinto!

data-blank-field, sets not only the initial value of the input as blank but also allows you to erase the date that you had on the input. This was part of the decisions that we made when we were developing it, so as of right now there's no way to separate the two. I'm not sure how that commented line would correct it but it's good to see that you have found a work around, we'll keep this in mind for the future.


Thanks for the feedback!

Rita



Hey Rita,

Thank you for your reply. I think Outsystems must give us more documentation about the widgets, because we don't know that we must used the data-blank-field extended property to resolve one problem.

I think, if you use a js library, you must give us the right documentation about the changes you made in it.

For now, I had to override your widget.  


Regards,

Nelson Pinto

I fully support the claim of Nelson Pinto about the need of more information about the widgets,


Regards

Alberto