p:calendar in version 10.0.0 and 10.0.2

UI Components for JSF
Melloware
Posts: 2660
Joined: 22 Apr 2013, 15:48

07 Jun 2021, 20:19

So your example did not have a "mask" in it. The above code looks like you only want to apply the mask if its not readonly or disabled. Can you verify that the mask is the problem in this Calendar case? Because your original example did not have a mask in it. I would juts like to be able to reproduce the issue in a PrimeFaces Test before submitting any fixes.

Let me know!
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

iexpertise
Posts: 26
Joined: 28 Oct 2014, 15:21

07 Jun 2021, 20:37

Melloware wrote:
07 Jun 2021, 20:19
So your example did not have a "mask" in it. The above code looks like you only want to apply the mask if its not readonly or disabled. Can you verify that the mask is the problem in this Calendar case? Because your original example did not have a mask in it. I would juts like to be able to reproduce the issue in a PrimeFaces Test before submitting any fixes.

Let me know!
Melloware I think there is a relationship. But I also think it goes beyond that. As it had "worked", I continued to make the migration to version 10. When continuing the tests I noticed that both the calendar and the datepicker when clicked, do not open the popup. Very strange. I feel tied up for not mastering the technology and being able to provide more details about the error to help you.

I apologize for that.

Code: Select all

<p:datePicker id="data" value="#{acompanhamentoInfantilMB.dataco}"
							pattern="dd/MM/yyyy" mask="true" readonlyInput="true" locale="pt"
							required="true" mode="popup" navigator="true" autoWidth="false"
							style="max-width: 100px;" showButtonPanel="true"
							mindate="#{acompanhamentoInfantilMB.minDate}"
							maxdate="#{acompanhamentoInfantilMB.maxDate}">
							<p:ajax event="dateSelect"
								listener="#{acompanhamentoInfantilMB.selecionarData}"
								update=":form:pg" />
						</p:datePicker>
Even a simple use like below doesn't work.

Code: Select all

<p:outputLabel for="basic" value="Data" />
						<p:datePicker id="basic" value="#{acompanhamentoInfantilMB.dataco}" />

Melloware
Posts: 2660
Joined: 22 Apr 2013, 15:48

07 Jun 2021, 20:51

You are right I should apply the same fix for 7362. I reopened your ticket and will apply the same to Calendar and DatePicker.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

iexpertise
Posts: 26
Joined: 28 Oct 2014, 15:21

09 Jun 2021, 21:16

Melloware wrote:
07 Jun 2021, 20:51
You are right I should apply the same fix for 7362. I reopened your ticket and will apply the same to Calendar and DatePicker.
I'm still learning to use these forum and git for opening to report problems. It's actually been a good learning experience, first using git instead of SVN, then Maven, anyway. I made this comment below at https://github.com/primefaces/primefaces/pull/7400 I will also do it here because I'm not sure if the comment there will have the meaning of a problem report.

I downloaded the source code from the master. Generated primefaces-11.0.0-SNAPSHOT.jar. I installed it in my project and the components still have problems, not opening the popup to select the date and other features such as selecting the hour and minute. The previous problem, which was a problem with the use of a mask, has apparently been solved. It remains these problems that I reported.

Melloware
Posts: 2660
Joined: 22 Apr 2013, 15:48

10 Jun 2021, 14:10

Yep still waiting on a PrimeFaces Test reproducer from you that works with `mvn clean jetty:run` so I can see your exact problem.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

iexpertise
Posts: 26
Joined: 28 Oct 2014, 15:21

10 Jun 2021, 22:00

Melloware wrote:
10 Jun 2021, 14:10
Yep still waiting on a PrimeFaces Test reproducer from you that works with `mvn clean jetty:run` so I can see your exact problem.
I discovered the problem, in part, in version 10 there was that problem in the inputmask that prevented the action from working. Similar problem was demonstrated in calendar and datepicker components. You implemented the solution in version 11 only, you didn't provide the script to work in version 10. What I did was delete the javascripts and download the snapshot of 11 that already had these implementations and delete the scripts below.

Code: Select all

			<script type="text/javascript">
	            //<![CDATA[

	            if (PrimeFaces.widget.InputMask) {
				    PrimeFaces.widget.InputMask.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};

				if (PrimeFaces.widget.Calendar) {
				    PrimeFaces.widget.Calendar.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};
				
				if (PrimeFaces.widget.DatePicker) {
				    PrimeFaces.widget.DatePicker.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};
				
	            //]]>
	        </script>
This code you provide.

Code: Select all

 if (PrimeFaces.widget.InputMask) {
				    PrimeFaces.widget.InputMask.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};
These other two pieces of code or built based on this commit https://github.com/primefaces/primeface ... dd649c02f5

Code: Select all

if (PrimeFaces.widget.Calendar) {
				    PrimeFaces.widget.Calendar.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};
				
				if (PrimeFaces.widget.DatePicker) {
				    PrimeFaces.widget.DatePicker.prototype.init = function(cfg) {
				        PrimeFaces.widget.BaseWidget.prototype.init.call(this, cfg);
				        if (this.cfg.mask && !this.jq.is('[readonly]') && !this.jq.is(':disabled')) {
				            this.jq.inputmask('remove').inputmask(this.cfg);
				        }
				        PrimeFaces.skinInput(this.jq);
				    }
				};
My thesis is that something else was done in another commit/issue that had an impact on the resolution of the problem. Would it be possible to provide a script code that works on version 10 and doesn't have to wait for version 11 to be released?

Another question, is there much to the release of a minimally stable version of version 11?

As I commented in another post, I don't really master this technology. It could be that my javascript implementation is incorrect.

Thank you very much.

Melloware
Posts: 2660
Joined: 22 Apr 2013, 15:48

10 Jun 2021, 22:30

You can always build 11.0.0 yourself just checkout from GitHub and run "mvn clean install" it builds 11.0.0_SNAPSHOT intou your .m2 folder so you can use. You can always not make it a snapshot too if you want to use it for Production.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

iexpertise
Posts: 26
Joined: 28 Oct 2014, 15:21

10 Jun 2021, 23:12

Melloware wrote:
10 Jun 2021, 22:30
You can always build 11.0.0 yourself just checkout from GitHub and run "mvn clean install" it builds 11.0.0_SNAPSHOT intou your .m2 folder so you can use. You can always not make it a snapshot too if you want to use it for Production.
If I can't use the snapshot for production because of instability, it's in development after all. We need a solution for version 10 that solves the issue of calendar and datepicker components. It would not be possible for you to build an interim solution as it was in this case for the inputmask problem https://github.com/primefaces/primeface ... -848955036?

My attempt to create this script didn't work very well, it hindered the opening and selection of date and time.

Melloware
Posts: 2660
Joined: 22 Apr 2013, 15:48

11 Jun 2021, 13:22

I don't work for PrimeTek so I don't control the release schedule of v11. I am just an open source volunteer.

Your other choice is to pay for PRO support and ask for those 3 fixes to be rolled into Elite 10.0.4 release.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 10.0.2 / PF Extensions 10.0.2

iexpertise
Posts: 26
Joined: 28 Oct 2014, 15:21

11 Jun 2021, 14:10

Melloware wrote:
11 Jun 2021, 13:22
I don't work for PrimeTek so I don't control the release schedule of v11. I am just an open source volunteer.

Your other choice is to pay for PRO support and ask for those 3 fixes to be rolled into Elite 10.0.4 release.
Thank you for all your support.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests