Hi.
The date field is misaligned, what can I do to fix this problem? It happens with all date fields (calendar);
https://drive.google.com/open?id=13IyQW ... sIIcDuskZf
[RESOLVED] Problem with date field (p:calendar)
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
Last edited by Elvis Fabiane on 24 May 2018, 18:49, edited 1 time in total.
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
This is component
CSS is the original theme of Verona...
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:cc="http://xmlns.jcp.org/jsf/composite"
xmlns:p="http://primefaces.org/ui">
<cc:interface>
<cc:attribute name="value" required="true" />
<cc:attribute name="required" type="java.lang.Boolean" default="false" />
<cc:attribute name="requiredMessage" default="O campo data é obrigatório" />
<cc:attribute name="yearRange" default="c-3:c+3" />
<cc:attribute name="size" default="10" />
<cc:attribute name="disabled" type="java.lang.Boolean" default="false" />
<cc:attribute name="process" />
<cc:attribute name="update" />
<cc:attribute name="oncomplete" />
<cc:attribute name="maxdate" />
<cc:attribute name="styleClass" />
</cc:interface>
<cc:implementation>
<!-- Função responsável por devolver o foco ao campo caso a data for inválida -->
<script type="text/javascript">
function focusFun(xhr, status, args) {
if (args.paramInvalidDate) {
PrimeFaces.focus(args.idComponent);
}
}
</script>
<p:calendar id="cal" value="#{cc.attrs.value}" showOn="button" navigator="true"
locale="pt_BR" size="#{cc.attrs.size}" onfocus="this.select()"
pattern="dd/MM/yyyy" buttonTabindex="-1" converter="convInputDate" type="tel"
mask="99/99/?9999" placeholder="__/__/____" required="#{cc.attrs.required}"
yearRange="#{cc.attrs.yearRange}" requiredMessage="#{cc.attrs.requiredMessage}"
rendered="#{cc.attrs.rendered}" disabled="#{cc.attrs.disabled}" maxdate="#{cc.attrs.maxdate}"
styleClass="#{cc.attrs.styleClass}">
<p:ajax process="@this #{cc.attrs.process}" update="@this #{cc.attrs.update}"
oncomplete="focusFun(xhr, status, args);#{cc.attrs.oncomplete}" />
</p:calendar>
</cc:implementation>
</html>
-
- Posts: 87
- Joined: 10 Jan 2018, 16:04
Which pf version you're using?
The code that you send me is not a runnable code so I altered it
and it works perfectly
The code that you send me is not a runnable code so I altered it
Code: Select all
<p:calendar id="cal" showOn="button" navigator="true"
pattern="dd/MM/yyyy" buttonTabindex="-1" type="tel"
mask="99/99/?9999" placeholder="__/__/____" >
</p:calendar>
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
Hello. The code I sent you is a component but the way you did also happens the error, just add an "ajax" with update "@this". The prime version is 6.2 ...
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
Only in mozilla. In the browsers Edge, Opera and Google Chrome works correctly.
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
Has anyone had this problem? I need to generate a version and I can not solve it.
Thank you.
Thank you.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Does the following code work for you on Mozilla?
Code: Select all
<p:calendar id="cal" showOn="button" navigator="true"
pattern="dd/MM/yyyy" buttonTabindex="-1" type="tel"
mask="99/99/?9999" placeholder="__/__/____" >
</p:calendar>
Github Profile: https://github.com/mertsincan
-
- Posts: 16
- Joined: 12 Dec 2013, 19:01
It works, but the problem is when you have an ajax @this update inside the component, so no ajax works.
--------------------------------
It does not work
--------------------------------
It does not work
Code: Select all
<p:calendar id="cal" showOn="button" navigator="true" pattern="dd/MM/yyyy" buttonTabindex="-1" type="tel" mask="99/99/?9999" placeholder="__/__/____" >
<p:ajax update="@this ... " />
</p:calendar>
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests