p:calendar locale fail

UI Components for JSF
pauga
Posts: 22
Joined: 03 Jun 2011, 08:49

01 Sep 2011, 10:25

Hi,

I´m using primefaces 3.0.M3 and Glassfish3.1. I cannot set the locale for a p:calendar component.

I´m trying to do it with the example code that appear in the primefaces web:

<p:calendar mode="inline" locale="ca" showButtonPanel="true" navigator="true"/>

but it doesn´t work.

Is necessary do any configuration on my server to use this? I test it in Firefox6 and GoogleChrome.

Can someone help me?

thanks, and sorry for my english :)

Organized
Posts: 7
Joined: 05 Aug 2011, 09:10

01 Sep 2011, 11:20

Same problem here, neither
  • Europe/Berlin (-> exception)
    nor
  • de
    nor
  • de_DE


is working. :(

turbinux
Posts: 2
Joined: 13 Sep 2011, 18:06

13 Sep 2011, 18:08

Same problem here... I tried a lot of "solutions" and nothing worked for me. using glassfish 3.0, primefaces 3.0M3 Tx

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

13 Sep 2011, 19:50

Put PrimeFaces.locales javascript property in head-tag.
Notice: locale="de" can be replaced by a backing bean property, e.g. locale="#{myBackingBean.myLocale}".

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:prime="http://primefaces.prime.com.tr/ui"
	locale="de">

	<h:head>

		<script type="text/javascript">
	    	PrimeFaces.locales['de'] =
	    	{
	            closeText: 'Schließen',
	            prevText: 'Zurück',
	            nextText: 'Weiter',
	            currentText: 'Start',
	            monthNames: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
	            monthNamesShort: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
	            dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
	            dayNamesShort: ['Son', 'Mon', 'Die', 'Mit', 'Don', 'Fre', 'Sam'],
	            dayNamesMin: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
	            weekHeader: 'Woche',
	            firstDay: 1,
	            isRTL: false,
	            showMonthAfterYear: false,
	            yearSuffix: '',
	            timeOnlyTitle: 'Nur Zeit',
	            timeText: 'Zeit',
	            hourText: 'Stunde',
	            minuteText: 'Minute',
	            secondText: 'Sekunde',
	            currentText: 'Aktuelles Datum',
	            ampm: false,
	            month: 'Monat',
	            week: 'Woche',
	            day: 'Tag',
	            allDayText: 'Ganzer Tag'
	        };
		</script>

	</h:head>

        . . .

</f:view
For more information and other translations see the following link:
http://code.google.com/p/primefaces/wik ... cesLocales
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

marconunes
Posts: 1
Joined: 13 Sep 2011, 14:26

14 Sep 2011, 18:31

Hi! I put the script in this location at my Master page (template.xhtml) and didn't work.

<?xml version='1.0' encoding='ISO-8859-1' ?> <!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:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.prime.com.tr/ui" >

<f:view contentType="text/html" locale="pt_BR">

<h:head>

<script type="text/javascript">

PrimeFaces?.locales'pt'? = {

closeText: 'Fechar', prevText: 'Anterior', nextText: 'Próximo', currentText: 'Começo', monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], monthNamesShort: 'Jul','Ago','Set','Out','Nov','Dez'?, dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'], dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], dayNamesMin: 'D','S','T','Q','Q','S','S'?, weekHeader: 'Semana', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '', timeOnlyTitle: 'Só Horas', timeText: 'Tempo', hourText: 'Hora', minuteText: 'Minuto', secondText: 'Segundo', currentText: 'Data Atual', ampm: false, month: 'Mês', week: 'Semana', day: 'Dia', allDayText : 'Todo Dia'

};

</script>

</h:head>

.....

Then i put the code into my child page and didn't work too. Please Help me.

<ui:composition xmlns="http://www.w3.org/1999/xhtml"

xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" template="/pages/menu/template.xhtml"> <h:head>

<script type="text/javascript">

PrimeFaces?.locales'pt'? = {

closeText: 'Fechar', prevText: 'Anterior', nextText: 'Próximo', currentText: 'Começo', monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], monthNamesShort: 'Jul','Ago','Set','Out','Nov','Dez'?, dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado'], dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], dayNamesMin: 'D','S','T','Q','Q','S','S'?, weekHeader: 'Semana', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '', timeOnlyTitle: 'Só Horas', timeText: 'Tempo', hourText: 'Hora', minuteText: 'Minuto', secondText: 'Segundo', currentText: 'Data Atual', ampm: false, month: 'Mês', week: 'Semana', day: 'Dia', allDayText : 'Todo Dia'

};

</script>

</h:head>

<ui:define name="body">

.....

RueKow
Posts: 331
Joined: 21 Jun 2011, 23:34
Location: Germany - Wiesbaden

14 Sep 2011, 22:52

You define <f:view contentType="text/html" locale="pt_BR">.

Please try to use following javascipt code:
PrimeFaces.locales['pt_BR'] = { ... }
PrimeFaces component should be:
<p:calendar locale="pt_BR" ... />

The local string should be the same ! In my facelet i use only "de" as locale string and it works fine.
Rüdiger

PrimeFaces 11.0 | Ultima 2.0
Mojarra 2.3 | Tomcat 8/9 | Win7/10 | OS X 10.14

_lucas_
Posts: 10
Joined: 09 Jul 2011, 22:42

15 Sep 2011, 04:32

Hi, I'm having the same problem, until M2 l18n worked, but after I changed to M3, my calendar changed to english again.
I'm almost sure its a bug, as the problem was not there before, but just to be safe, and as the issue tracker asked to post before sendind a issue...
I'm using Primefaces M3, on tomcat 7 and my form is using a template as follows:

TEMPLATE

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:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<h:head>
	<ui:insert name="css" />
	<link type="text/css" rel="StyleSheet" href="css/default.css" />
	<link type="text/css" rel="StyleSheet" href="css/novoComReset.css" />

	
		
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


	<title><ui:insert name="title"></ui:insert></title>
	<ui:insert name="js"></ui:insert>
</h:head>



	<f:view contentType="text/html">

		<p:layout fullPage="true">

			<p:layoutUnit position="north" height="85" header="Banner"
				resizable="false" closable="false" collapsible="true">
	<h:form id="formLogin2" prependId="false">
					<p:fieldset id="fieldLogin" legend="Login" style="font-size:10px;"
						rendered="#{barra.renderLogin}">



						<p:growl id="messages" showDetail="false" life="7000" />

						<h:outputLabel value="Usu&aacute;rio: " for="user2">

							<p:inputText id="user2" required="true" value="#{login.user}"
								requiredMessage="Preencha o Usuário" />

						</h:outputLabel>


						<h:outputLabel value="Senha: " for="senha2">

							<p:password id="senha2" feedback="false" value="#{login.senha}"
								required="true" requiredMessage="Digite a Senha" />

						</h:outputLabel>


						<br />
						<p:commandButton value="Entrar" action="#{login.validateUser}"
							update="formLogin,formBarraMenu" />

						<a href="http://www.fiap.com.br">&nbsp;&nbsp;N&atilde;o
							consigo me conectar</a>



					</p:fieldset>

				</h:form>
			</p:layoutUnit>

				<p:layoutUnit position="west"  minSize="180"
				maxSize="180" resizable="false" closable="false" collapsible="true" rendered="#{barra.renderUser}">
<p:layout><p:layoutUnit position="north"  minSize="230"   header="Sugestão de Cursos"> 
<c:if test="#{!empty(login.lista)}">
<h:outputText value="Baseado no seu perfil identificamos os seguintes Cursos:"/>
</c:if>
<c:if test="#{empty(login.lista)}">
<h:outputText value="Nenhum Curso encontrado"/>
</c:if>
<h:form>
<br/>
<c:forEach items="#{login.lista}"   var="curso"> 
						<h:commandLink styleClass="link" value="#{curso.nm_oportunidade}"
							action="#{oport.exibirDetalhes}">
							<f:param name="item" value="#{curso.id_oportunidade}" />
						</h:commandLink>
						</c:forEach>
						</h:form>
</p:layoutUnit>

<p:layoutUnit visible="#{oport.renderSugestao}" position="center"  id="sugEmp"  header="Sugestão de Cursos Por Emprego" >
<h:outputText value="De acordo com os pré-requisitos desta vaga, talvez voce se interesse pelos seguintes Cursos:"/> 


</p:layoutUnit></p:layout>

			</p:layoutUnit>


			<p:layoutUnit position="center" scrollable="true">

					<ui:include src="Menu.xhtml" />


				<ui:insert  name="centro">

				</ui:insert>
			</p:layoutUnit>

		

		</p:layout>

	</f:view>

</html>
FORM

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<ui:composition template="index.xhtml">



	<ui:define name="title">Cadastro de Oportunidades</ui:define>
	
		<ui:define name="js">

	<script type="text/javascript">
		function show() {
            var i=0;
			var t = document.getElementById("dialog");
			var nodes = t.childNodes;
			
			for (i = 0; i != nodes.length; i++) {
				if (nodes[i].tagName == "FORM") {
                   var x = nodes[i].childNodes[3].innerHTML;      
				}
			}
			if (x == "") {
				myDialog.hide();
			}

		}
	
	</script>

<script type="text/javascript" src="js/locales.js">
</script>
</ui:define>
<ui:define name="centro">

	<p:ajaxStatus onstart="statusDialog.show();"
		onsuccess="statusDialog.hide();" />

	<p:dialog modal="true" widgetVar="statusDialog" header="Status"
		draggable="false" closable="false" resizable="false">
		<p:graphicImage value="/images/ajax-loader.gif" />
	</p:dialog>
	<p:dialog widgetVar="myDialog" onShow="show();"   resizable="false"   id="dialog">
		<h:form id="formDialog" prependId="false">
			<h:outputText value="#{oport.mensagem}" id="msg" >
			
			</h:outputText>
			
		</h:form>
		<p:ajax listener="#{oport.reset}" update="msg" /> 
	</p:dialog>
	<p:fieldset legend="Cadastro de Oportunidades" id="fieldVagas">
		<h:form id="formOportunidade" prependId="false">
			<p:growl sticky="true" />
			<p:accordionPanel autoHeight="false" collapsible="true"
				activeIndex="-1">

				<p:tab title="Est&aacute;gio">

					<div style="float: left;">
						<p>

							<h:outputLabel styleClass="required" for="titulo"
								value="T&iacute;tulo da Vaga " />
							<p:inputText required="true" value="#{oport.emp.nm_oportunidade}"
								id="titulo" label="T&iacute;tulo da Vaga  "
								style="margin-left:50%;" />
							<p:message for="titulo" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						

							<p:panel id="panelEx" style="border:0px">
		<c:forEach items="#{oport.req}" var="req">
					<p:panel id="panel" rendered="#{oport.render}">
				
								
							
					
								<h:outputLabel for="requisitos" value="Pr&eacute;-requisitos" />
							<p:inputTextarea required="false"
								style="width:200px;height:90px;margin-left:40%;"
								value="#{req.requisito}" id="requisitos" />
						<p:commandButton process="panelEx" value="Adicionar novo Pr&eacute;-requisito" update="panelEx" actionListener="#{oport.addRequisito}"/>
						
						</p:panel>
						</c:forEach>
						</p:panel>	
							
						
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel styleClass="required" for="entrada"
								value="Hor&aacute;rio de Entrada " />
							<p:inputMask style="margin-left:59%;" mask="99:99" id="entrada"
								value="#{oport.emp.hr_inicio}" validator="#{oport.validateHora}"
								validatorMessage="Hor&aacute;rio de Entrada:Hora Invalida"
								required="true"
								requiredMessage=" Hor&aacute;rio de Entrada:Valor n&atilde;o pode ser nulo!" />
							<p:message for="entrada" />

						</p>
					</div>
					<div style="float: left; margin-left: 10%;">
						<p>

							<h:outputLabel styleClass="required" for="saida"
								value="Hor&aacute;rio de Sa&iacute;da " />
							<p:inputMask style="margin-left:55%;" mask="99:99" id="saida"
								required="true" value="#{oport.emp.hr_termino}"
								validator="#{oport.validateHora}"
								validatorMessage="Hor&aacute;rio de Sa&iacute;da:Hora Invalida"
								requiredMessage=" Hor&aacute;rio de Sa&iacute;da:Valor n&atilde;o pode ser nulo!" />
							<p:message for="saida" />

						</p>
					</div>
					<div style="float: left; margin-left: 10%; width: 19%;">
						<p>

							<h:outputLabel styleClass="required" for="periodo"
								value="Per&iacute;odo" />
							<p:selectOneMenu label="Per&iacute;odo" styleClass="required"
								id="periodo" value="#{oport.id}" required="true"
								style="width:98px;margin-left:5%"
								requiredMessage=" Per&iacute;odo:valor não pode ser nulo! ">
								
								<f:selectItems id="itens" value="#{oport.periodoValues}" />

							</p:selectOneMenu>
							<p:message for="periodo" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="desc"
								value="Descri&ccedil;&atilde;o do Est&aacute;gio " />
							<p:inputTextarea
								style="width:200px;height:120px;margin-left:45%;"
								required="false" value="#{oport.emp.ds_oportunidade}" id="desc" />

						</p>
					</div>
					<div>
						<p>

							<h:outputLabel styleClass="required" for="bolsa"
								value="Bolsa Aux&iacute;lio " />
							<p:inputText id="bolsa" required="true"
								value="#{oport.emp.vl_salario}" style="margin-left:7%;"
								validator="#{oport.validarSalario}"  title="Bolsa Aux&iacute;lio"/>
							<p:message for="bolsa" />
						</p>
					</div>
						<div>
						<p>

							<h:outputLabel styleClass="required" for="beneficios"
								value=" Beneficios Adicionais " />
							<p:inputTextarea id="beneficios" 
								value="#{oport.emp.beneficios}" style="width:200px;height:90px;margin-left:7%;" />
							<p:message for="beneficios" />
						</p>
					</div>
					<p:fieldset legend="Endereco do Est&aacute;gio" id="fieldEndV">
						<div style="float: left;">
							<p>


								<h:outputLabel value="Logradouro" styleClass="required"
									for="logradouro" />
								<p:inputText value="#{oport.end.logradouro}" id="logradouro"
									required="true" label="Logradouro" style="margin-left:48%" />
								<p:message for="logradouro" />
							</p>
						</div>
						<div style="float: left; margin-left: 8%;">
							<p>

								<h:outputLabel value="N&uacute;mero " styleClass="required"
									for="num" />
								<p:inputText value="#{oport.emp.nr_endereco}" id="num"
									required="true" maxlength="5"
									style="width:50px;margin-left:58%;" />
								<p:message for="num" />
							</p>
						</div>
						<div style="float: left; clear: both;">
							<p>

								<h:outputLabel value="Complemento" />
								<p:inputText value="#{oport.emp.nm_compl}"
									style="margin-left:53%" />

							</p>
						</div>
						<div style="float: left; clear: both;">
							<p>

								<h:outputLabel value="Bairro" />
								<p:inputText value="#{oport.end.bairro}" style="margin-left:37%" />

							</p>
						</div>
						<div style="float: left; clear: both;">
							<p>

								<h:outputLabel value="CEP " styleClass="required" for="cep" />
								<p:inputMask id="cep" value="#{oport.end.cep}" mask="99999-999"
									required="true" label="CEP" validator="#{oport.validateCEP}" />
								<p:message for="cep" />
							</p>
						</div>
						<div style="float: left; clear: both;">
							<p>

								<h:outputLabel styleClass="required" for="estado" value="Estado" />
								<p:selectOneMenu id="estado" value="#{oport.estadoId}"
									required="true"
									requiredMessage="Estado:Valor não pode ser nulo!"
									style="width:55px;">
									<f:selectItems itemLabel="UF" noSelectionValue="-1" id="itensE"
										value="#{oport.estadoValues}" />
									<p:ajax listener="#{oport.preencherCidades}" update="cidades"
										process="@this" async="true" />
								</p:selectOneMenu>
								<p:message for="estado" />
							</p>
						</div>
						<div style="float: left; margin-left: 5%;">
							<p>
								<h:outputLabel styleClass="required" for="cidades"
									value="Cidade" />
								<p:selectOneMenu id="cidades" value="#{oport.cidadeId}"
									required="true"
									requiredMessage="Cidade:Valor não pode ser nulo"
									style="width:150px;">

									<f:selectItems itemLabel="Cidade" noSelectionValue="-1"
										id="itensCid" value="#{oport.cidadeValues}" />


								</p:selectOneMenu>
								<p:message for="cidades" />
							</p>
						</div>
					</p:fieldset>
					<p style="text-align: center">
						<p:commandButton value="Cadastrar Est&aacute;gio"
							actionListener="#{oport.inserirEstagio}"
							update="formOportunidade,formDialog" oncomplete="myDialog.show()" />

					</p>

				</p:tab>
			</p:accordionPanel>

		</h:form>
		<h:form id="formCon" prependId="false">
			<p:growl sticky="true" />
			<p:accordionPanel autoHeight="false" collapsible="true"
				activeIndex="-1">
				<p:tab title="Concurso">
					<div style="float: left;">
						<h:outputLabel styleClass="required" for="concurso"
							value="Titulo do Concurso " />
						<p:inputText required="true" value="#{oport.con.nm_oportunidade}"
							id="concurso" label="Titulo do Concurso "
							style="margin-left:50%;" />
						<p:message for="concurso" />
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="requisitosCon" value="Pr&eacute;-requisitos" />
							<p:inputTextarea required="false"
								style="width:200px;height:90px;margin-left:40%;"
								value="#{oport.con.nm_pre_requisito}" id="requisitosCon"
								label="Pr&eacute;-requisitos " />
							<p:message for="requisitosCon" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel styleClass="required" for="inicioCon"
								value="Hor&aacute;rio de Inicio " />
							<p:inputMask mask="99:99" id="inicioCon"
								value="#{oport.con.hr_inicio}" style="margin-left:55%;"
								validator="#{oport.validateHora}"
								label="Hor&aacute;rio de Inicio" />
							<p:message for="inicioCon" />

						</p>
					</div>
					<div style="float: left; margin-left: 6%">
						<p>

							<h:outputLabel styleClass="required" for="terminoCon"
								value="Hor&aacute;rio de T&eacute;rmino " />
							<p:inputMask mask="99:99" id="terminoCon" required="true"
								value="#{oport.con.hr_termino}" style="margin-left:58%;"
								validator="#{oport.validateHora}"
								label="Hor&aacute;rio de T&eacute;rmino" />

							<p:message for="terminoCon" />
						</p>
					</div>
					<div style="float: left; margin-left: 8%; width: 19%;">
						<p>

							<h:outputLabel styleClass="required" for="periodoCon"
								value="Per&iacute;odo" />
							<p:selectOneMenu id="periodoCon" value="#{oport.id}"
								required="true" style="width:98px;margin-left:5%;"
								requiredMessage=" Per&iacute;odo do Concurso:Valor nulo">

								<f:selectItems id="itensCon" value="#{oport.periodoValues}" />

							</p:selectOneMenu>
							<p:message for="periodoCon" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="descCon"
								value="Descri&ccedil;&atilde;o do Concurso " />
							<p:inputTextarea
								style="width:200px;height:120px;margin-left:45%;"
								required="false" value="#{oport.con.ds_oportunidade}"
								id="descCon" label="Descri&ccedil;&atilde;o" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="valorCon"
								value="Valor da Inscri&ccedil;&atilde;o" styleClass="required" />
							<p:inputText required="true" value="#{oport.con.vl_inscricao}"
								style="margin-left:58%;" id="valorCon"
								label="Inscri&ccedil;&atilde;o" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="DtIniCon" value="Data de Inicio"
								styleClass="required" style="margin-right:15%;" />
							<p:calendar required="true" value="#{oport.comp.inicio}"
								id="dtIniCon" selectOtherMonths="true" mode="popup"
								pattern="dd/MM/yyyy" readOnlyInputText="true" locale="br"
								label="Data de Inicio" mindate="#{oport.now}">
								<f:convertDateTime dateStyle="short" />
							</p:calendar>
							<p:message for="dtIniCon" />
						</p>
					</div>
					<div style="float: left; margin-left: 14%;">
						<p>


							<h:outputLabel for="DtTermCon" value="Data de T&eacute;rmino"
								styleClass="required" style="margin-right:15%;" />
							<p:calendar required="true" value="#{oport.comp.termino}"
								id="dtTermCon" selectOtherMonths="true" mode="popup"
								pattern="dd/MM/yyyy" readOnlyInputText="true" locale="br"
								style=" margin-left:40%;" label="Data de T&eacute;rmino "
								mindate="#{oport.now}">
								<f:convertDateTime dateStyle="short" />
							</p:calendar>
							<p:message for="dtTermCon" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="urlCon" styleClass="required"
								value="Site do curso" />
							<p:inputText value="#{oport.con.url}" id="urlCon" required="true"
								label="Site do Concurso " style=" margin-left:50%;" />

							<p:message for="urlCon" />
						</p>
					</div>
						<div style="float: left; clear: both;">
								<p>

									<h:outputLabel styleClass="required" for="estadoCon"
										value="Estado" />
									<p:selectOneMenu id="estadoCon" value="#{oport.estadoId}"
										required="true"
										requiredMessage="Estado:Valor não pode ser nulo!"
										style="width:55px;">
										<f:selectItems itemLabel="UF" noSelectionValue="-1"
											id="itensECon" value="#{oport.estadoValues}" />
										<p:ajax listener="#{oport.preencherCidades}" update="cidadesCon"
											process="@this" async="true" />
									</p:selectOneMenu>
									<p:message for="estadoCon" />
								</p>
							</div>
							<div style="float: left; margin-left: 5%;">
								<p>
									<h:outputLabel styleClass="required" for="cidadesCon"
										value="Cidade" />
									<p:selectOneMenu id="cidadesCon" value="#{oport.cidadeId}"
										required="true"
										requiredMessage="Cidade:Valor não pode ser nulo"
										style="width:150px;">

										<f:selectItems itemLabel="Cidade" noSelectionValue="-1"
											id="itensCCon" value="#{oport.cidadeValues}" />


									</p:selectOneMenu>
									<p:message for="cidadesCon" />
								</p>
							</div>
					<div style="float: left; clear: both; margin-left: 45%;">
						<p:commandButton value="cadastrar Concurso"
							action="#{oport.incluirConcurso}" update="formCon,formDialog" oncomplete="myDialog.show()" />
					</div>

				</p:tab>
			</p:accordionPanel>
		</h:form>
		<h:form id="formCurso" prependId="false">
			<p:growl sticky="true" />

			<p:accordionPanel autoHeight="false" collapsible="true"
				activeIndex="-1">

				<p:tab title="Curso">
					<div style="float: left;">
						<h:outputLabel styleClass="required" for="curso"
							value="Nome do Curso " />
						<p:inputText required="true"
							value="#{oport.curso.nm_oportunidade}" id="curso"
							label="Nome do Curso " style="margin-left:50%;" />
						<p:message for="curso" />
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="requisitosC" value="Pr&eacute;-requisitos" />
							<p:inputTextarea required="false"
								style="width:200px;height:90px;margin-left:40%;"
								value="#{oport.curso.nm_pre_requisito}" id="requisitosC"
								label="Pr&eacute;-requisitos " />
							<p:message for="requisitosC" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel styleClass="required" for="inicio"
								value="Hor&aacute;rio de Inicio " />
							<p:inputMask mask="99:99" id="inicio"
								value="#{oport.curso.hr_inicio}" style="margin-left:55%;"
								validator="#{oport.validateHora}"
								label="Hor&aacute;rio de Inicio" />
							<p:message for="inicio" />

						</p>
					</div>
					<div style="float: left; margin-left: 6%">
						<p>

							<h:outputLabel styleClass="required" for="termino"
								value="Hor&aacute;rio de T&eacute;rmino " />
							<p:inputMask mask="99:99" id="termino" required="true"
								value="#{oport.curso.hr_termino}" style="margin-left:58%;"
								validator="#{oport.validateHora}"
								label="Hor&aacute;rio de T&eacute;rmino" />

							<p:message for="termino" />
						</p>
					</div>
					<div style="float: left; margin-left: 8%; width: 19%;">
						<p>

							<h:outputLabel styleClass="required" for="periodoC"
								value="Per&iacute;odo" />
							<p:selectOneMenu id="periodoC" value="#{oport.id}"
								required="true" style="width:98px;margin-left:5%;"
								requiredMessage=" Per&iacute;odo do curso:Valor nulo">

								<f:selectItems id="itensC" value="#{oport.periodoValues}" />

							</p:selectOneMenu>
							<p:message for="periodoC" />
						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="descC"
								value="Descri&ccedil;&atilde;o do curso " />
							<p:inputTextarea
								style="width:200px;height:120px;margin-left:45%;"
								required="false" value="#{oport.curso.ds_oportunidade}"
								id="descC" label="Descri&ccedil;&atilde;o" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="valorC" value="Custo Total do curso"
								styleClass="required" />
							<p:inputText required="true"
								value="#{oport.curso.vl_investimento}" style="margin-left:58%;"
								id="valorC" label="Custo Total" />

						</p>
					</div>
					<div style="float: left; margin-left: 10%;">
						<p>

							<h:outputLabel for="parcC"
								value="M&aacute;ximo de parcelas permitidas"
								styleClass="required" />
							<p:inputText style=" margin-left:67%;" required="true"
								value="#{oport.curso.parcelamento}" id="parcC"
								label="Parcelamento" />
							<p:message for="parcC" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="DtIniC" value="Data de Inicio"
								styleClass="required" style="margin-right:15%;" />
							<p:calendar required="true" value="#{oport.comp.inicio}"
								id="dtIniC" selectOtherMonths="true" mode="popup"
								pattern="dd/MM/yyyy" readOnlyInputText="true" locale="br"
								label="Data de Inicio" mindate="#{oport.now}">
								<f:convertDateTime dateStyle="short" />
							</p:calendar>
							<p:message for="dtIniC" />
						</p>
					</div>
					<div style="float: left; margin-left: 14%;">
						<p>


							<h:outputLabel for="DtTermC" value="Data de T&eacute;rmino"
								styleClass="required" style="margin-right:15%;" />
							<p:calendar required="true" value="#{oport.comp.termino}"
								id="dtTermC" selectOtherMonths="true" mode="popup"
								pattern="dd/MM/yyyy" readOnlyInputText="true" locale="br"
								style=" margin-left:40%;" label="Data de T&eacute;rmino "
								mindate="#{oport.now}">
								<f:convertDateTime dateStyle="short" />
							</p:calendar>
							<p:message for="dtTermC" />

						</p>
					</div>
					<div style="float: left; clear: both;">
						<p>

							<h:outputLabel for="urlC" value="Site do curso" />
							<p:inputText value="#{oport.curso.url}" id="urlC"
								label="Site do Curso " style=" margin-left:50%;"></p:inputText>


						</p>
					</div>
					<div
						style="float: left; clear: both; width: 70%; margin-bottom: 4%">
						<p:fieldset legend="Local do Curso" id="fieldEndC">
							<div style="float: left;">
								<p>


									<h:outputLabel value="Logradouro" styleClass="required"
										for="logradouroC" />
									<p:inputText value="#{oport.end.logradouro}" id="logradouroC"
										required="true" label="Logradouro" style="margin-left:48%" />
									<p:message for="logradouroC" />
								</p>
							</div>
							<div style="float: left; margin-left: 8%;">
								<p>

									<h:outputLabel value="N&uacute;mero " styleClass="required"
										for="numC" />
									<p:inputText  
										value="#{oport.curso.nr_endereco}" id="numC" required="true"
										maxlength="5" style="width:50px;margin-left:58%;" />
									<p:message for="numC" />
								</p>
							</div>
							<div style="float: left; clear: both;">
								<p>

									<h:outputLabel value="Complemento" />
									<p:inputText value="#{oport.curso.nm_compl}"
										style="margin-left:53%" />

								</p>
							</div>
							<div style="float: left; clear: both;">
								<p>

									<h:outputLabel value="Bairro" />
									<p:inputText value="#{oport.end.bairro}"
										style="margin-left:37%" />

								</p>
							</div>
							<div style="float: left; clear: both;">
								<p>

									<h:outputLabel value="CEP " styleClass="required" for="cepC" />
									<p:inputMask id="cepC" value="#{oport.end.cep}"
										mask="99999-999" required="true" label="CEP"
										style="margin-left:30%" validator="#{oport.validateCEP}" />
									<p:message for="cepC" />
								</p>
							</div>
							<div style="float: left; clear: both;">
								<p>

									<h:outputLabel styleClass="required" for="estadoC"
										value="Estado" />
									<p:selectOneMenu id="estadoC" value="#{oport.estadoId}"
										required="true"
										requiredMessage="Estado:Valor não pode ser nulo!"
										style="width:55px;">
										<f:selectItems itemLabel="UF" noSelectionValue="-1"
											id="itensEC" value="#{oport.estadoValues}" />
										<p:ajax listener="#{oport.preencherCidades}" update="cidadesC"
											process="@this" async="true" />
									</p:selectOneMenu>
									<p:message for="estadoC" />
								</p>
							</div>
							<p:ajaxStatus>
								<f:facet name="start">
									<h:graphicImage value="../images/ajax-loader.gif" />
								</f:facet>

							</p:ajaxStatus>
							<div style="float: left; margin-left: 5%;">
								<p>
									<h:outputLabel styleClass="required" for="cidadesC"
										value="Cidade" />
									<p:selectOneMenu id="cidadesC" value="#{oport.cidadeId}"
										required="true"
										requiredMessage="Cidade:Valor não pode ser nulo"
										style="width:150px;">

										<f:selectItems itemLabel="Cidade" noSelectionValue="-1"
											id="itensCC" value="#{oport.cidadeValues}" />


									</p:selectOneMenu>
									<p:message for="cidadesC" />
								</p>
							</div>
						</p:fieldset>
					</div>
					<div style="float: left; clear: both; margin-left: 45%;">
						<p:commandButton value="cadastrar Curso"
							action="#{oport.incluirCurso}" update="formCurso,formDialog" oncomplete="myDialog.show()" />
					</div>

				</p:tab>
			</p:accordionPanel>
		</h:form>
	</p:fieldset>

</ui:define>
</ui:composition>
 </html>
LOCALES.JS

Code: Select all

PrimeFaces.locales['br'] = {
                closeText: 'Fechar',
                prevText: 'Anterior',
                nextText: 'Pr&oacute;ximo',
                currentText: 'Come&ccedil;o',
                monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
                monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun', 'Jul','Ago','Set','Out','Nov','Dez'],
                dayNames: ['Domingo','Segunda','Ter&ccedil;a','Quarta','Quinta','Sexta','S&aacute;bado'],
                dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
                dayNamesMin: ['D','S','T','Q','Q','S','S'],
                weekHeader: 'Semana',
                firstDay: 1,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: '',
                timeOnlyTitle: 'S&oacute; Horas',
                timeText: 'Tempo',
                hourText: 'Hora',
                minuteText: 'Minuto',
                secondText: 'Segundo',
                currentText: 'Data Atual',
                ampm: false,
                month: 'M&ecirc;s',
                week: 'Semana',
                day: 'Dia',
                allDayText : 'Todo Dia'
            };
so if anyone have a solution... otherwise I will send this issue

mustafa.cataltepe
Posts: 14
Joined: 10 Nov 2010, 17:48

06 Oct 2011, 08:24

I am currenty having the same issue with 3.0.M3 on Mojarra 2.1.2 running on Tomcat 7. İ've added the mentioned js codes as intended but my calendar still stays in english but showcase which is M4 Snapshot works so i assume its been fixed in that snapshot but not working under M3. Any suggestion or solution to this problem?

Keith Wong
Posts: 11
Joined: 04 Oct 2011, 09:33

06 Oct 2011, 11:01

It works fine for me. Make sure you have defined <supported-locale>'s in faces-config.xml.
Primefaces 3.4.2
MyFaces 2.1.9
WebSphere 8.5

mustafa.cataltepe
Posts: 14
Joined: 10 Nov 2010, 17:48

06 Oct 2011, 13:02

have <locale-config> in my faces-config.xml already but it is not working currenty. Keith are you using 3.0.M3 or 3.0.M4-SNAPSHOT?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests