Ajuda com o Plugin Calendar do Grails
20/02/2009 00:00
0
Amigos,

Estou tentando usar o plugin Calaendr. Consegui colocá-lo no meu formulário e td mais, porém quando faço a persistencia ele salva apenas a data, mas a hora fica com zero.
Imprime o parametro no Controller antes de salvar e aparece a data e hora e lá, porém depois de salvar a hora fica zerada.
Outro problema que estou enfrentando é quando preciso editar, pois a data e hora (apesar de zerada) não aperecem no form edit, tentei colocar um campo com text e aperece a data, porém no componente do Calendar não consigo setar um value e desssa forma o valor não aparece.
Alguém já usou esse plugin? podem me ajudar?

Desde já agradeçoa atenção e colaboração...Abraços!
Tags: Grails


0
Tava pesquisando aqui e vi que saiu uma nova versão, vou testar p ver se resolve meu problema. QQ aviso.
20/02/2009 00:00


0
Resolvido...a nova versão já vem com as correções necessárias
20/02/2009 00:00


0
Olá Ronny qual versão do plugin vc está utilizando?

Você teve mais algum problema?

Se encontrar algum bug, ou melhoria, por favor crie um issue no jira

http://jira.codehaus.org/browse/GRAILSPLUGINS/component/13742

=)
Maxwell
03/03/2009 00:00


0
Quando tive o problema estava usando a 1.0.1, então migrei p 1.1 e funcionou no firefox, mas tava dando pau no IE.
Baixei recentemente a 1.1.1 e resolveu esse problema do IE tbm. Até agora não tive mais problemas.
Com certeza é um excelente plugin, muito útil. Estou acompanhando sua evolução e a cada novo realease baixo p testar, inclusive já estou aguardando a 1.2.
04/03/2009 00:00


0
Em que local da GSP eu tenho de usar o resource:

<calendar&#58;resources lang=&quot;en&quot; theme=&quot;tiger&quot;/>

??? <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
07/03/2009 00:00


0
Horus,

Vc coloca na TAG <head> das GSPs onde vai ficar o componente, ex.:

Create.gsp



<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/>
<meta name=&quot;layout&quot; content=&quot;main&quot; />
<calendar&#58;resources lang=&quot;br&quot; theme=&quot;tiger&quot;/>
<title>Create Noticia</title>
</head>
<body>
<div class=&quot;nav&quot;>
<span class=&quot;menuButton&quot;><a class=&quot;home&quot; href=&quot;$&#123;createLinkTo(dir&#58;'')&#125;&quot;>Home</a></span>
<span class=&quot;menuButton&quot;><g&#58;link class=&quot;list&quot; action=&quot;list&quot;>Noticia List</g&#58;link></span>
</div>
<div class=&quot;body&quot;>
<h1>Nova Notícia</h1>
<g&#58;if test=&quot;$&#123;flash.message&#125;&quot;>
<div class=&quot;message&quot;>$&#123;flash.message&#125;</div>
</g&#58;if>
<g&#58;hasErrors bean=&quot;$&#123;noticiaInstance&#125;&quot;>
<div class=&quot;errors&quot;>
<g&#58;renderErrors bean=&quot;$&#123;noticiaInstance&#125;&quot; as=&quot;list&quot; />
</div>
</g&#58;hasErrors>
<g&#58;form action=&quot;save&quot; method=&quot;post&quot; >
<div class=&quot;dialog&quot;>
<table>
<tbody>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;isAtivo&quot;>Ativo&#58;</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'isAtivo','errors')&#125;&quot;>
<g&#58;checkBox name=&quot;isAtivo&quot; value=&quot;$&#123;noticiaInstance?.isAtivo&#125;&quot; ></g&#58;checkBox>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txTitulo&quot;>Título&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txTitulo','errors')&#125;&quot;>
<input type=&quot;text&quot; size=&quot;30px&quot; maxlength=&quot;60&quot; id=&quot;txTitulo&quot; name=&quot;txTitulo&quot; value=&quot;$&#123;fieldValue(bean&#58;noticiaInstance,field&#58;'txTitulo')&#125;&quot;/>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txResumo&quot;>Resumo&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txResumo','errors')&#125;&quot;>
<fckeditor&#58;editor
name=&quot;txResumo&quot;
width=&quot;500px&quot;
height=&quot;300px&quot;
toolbar=&quot;Standard&quot;
fileBrowser=&quot;default&quot;>
</fckeditor&#58;editor>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txDescricao&quot;>Descrição&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txDescricao','errors')&#125;&quot;>
<fckeditor&#58;editor
name=&quot;txDescricao&quot;
width=&quot;500px&quot;
height=&quot;400px&quot;
toolbar=&quot;Standard&quot;
fileBrowser=&quot;default&quot;>
</fckeditor&#58;editor>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;dtInicio&quot;>Início da Publicação&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'dtInicio','errors')&#125;&quot;>
<calendar&#58;datePicker name=&quot;dtInicio&quot; value=&quot;$&#123;noticiaInstance?.dtInicio&#125;&quot; dateFormat=&quot;%d/%m/%Y %H&#58;%M&quot; showTime=&quot;false&quot; ></calendar&#58;datePicker>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;dtFim&quot;>Fim da Publicação&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'dtFim','errors')&#125;&quot;>
<calendar&#58;datePicker name=&quot;dtFim&quot; value=&quot;$&#123;noticiaInstance?.dtFim&#125;&quot; dateFormat=&quot;%d/%m/%Y %H&#58;%M&quot; showTime=&quot;false&quot; ></calendar&#58;datePicker>
</td>
</tr>

</tbody>
</table>
</div>
<div class=&quot;buttons&quot;>
<span class=&quot;button&quot;><input class=&quot;save&quot; type=&quot;submit&quot; value=&quot;Create&quot; /></span>
</div>
</g&#58;form>
</div>
</body>
</html>


edit.gsp



<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/>
<meta name=&quot;layout&quot; content=&quot;main&quot; />
<calendar&#58;resources lang=&quot;br&quot; theme=&quot;tiger&quot;/>
<title>Edit Noticia</title>
</head>
<body>
<div class=&quot;nav&quot;>
<span class=&quot;menuButton&quot;><a class=&quot;home&quot; href=&quot;$&#123;createLinkTo(dir&#58;'')&#125;&quot;>Home</a></span>
<span class=&quot;menuButton&quot;><g&#58;link class=&quot;list&quot; action=&quot;list&quot;>Noticia List</g&#58;link></span>
<span class=&quot;menuButton&quot;><g&#58;link class=&quot;create&quot; action=&quot;create&quot;>New Noticia</g&#58;link></span>
</div>
<div class=&quot;body&quot;>
<h1>Edit Noticia</h1>
<g&#58;if test=&quot;$&#123;flash.message&#125;&quot;>
<div class=&quot;message&quot;>$&#123;flash.message&#125;</div>
</g&#58;if>
<g&#58;hasErrors bean=&quot;$&#123;noticiaInstance&#125;&quot;>
<div class=&quot;errors&quot;>
<g&#58;renderErrors bean=&quot;$&#123;noticiaInstance&#125;&quot; as=&quot;list&quot; />
</div>
</g&#58;hasErrors>
<g&#58;form method=&quot;post&quot; >
<input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;$&#123;noticiaInstance?.id&#125;&quot; />
<div class=&quot;dialog&quot;>
<table>
<tbody>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;isAtivo&quot;>Ativo&#58;</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'isAtivo','errors')&#125;&quot;>
<g&#58;checkBox name=&quot;isAtivo&quot; value=&quot;$&#123;noticiaInstance?.isAtivo&#125;&quot; ></g&#58;checkBox>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txTitulo&quot;>Título&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txTitulo','errors')&#125;&quot;>
<input type=&quot;text&quot; size=&quot;30px&quot; maxlength=&quot;60&quot; id=&quot;txTitulo&quot; name=&quot;txTitulo&quot; value=&quot;$&#123;fieldValue(bean&#58;noticiaInstance,field&#58;'txTitulo')&#125;&quot;/>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txResumo&quot;>Resumo&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txResumo','errors')&#125;&quot;>
<fckeditor&#58;editor
name=&quot;txResumo&quot;
width=&quot;500px&quot;
height=&quot;400px&quot;
toolbar=&quot;Standard&quot;
fileBrowser=&quot;default&quot;>
</fckeditor&#58;editor>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;txDescricao&quot;>Descrição&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'txDescricao','errors')&#125;&quot;>
<fckeditor&#58;editor
name=&quot;txDescricao&quot;
width=&quot;500px&quot;
height=&quot;400px&quot;
toolbar=&quot;Standard&quot;
fileBrowser=&quot;default&quot;>
</fckeditor&#58;editor>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;dtInicio&quot;>Início da Publicação&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'dtInicio','errors')&#125;&quot;>
<calendar&#58;datePicker name=&quot;dtInicio&quot; value=&quot;$&#123;noticiaInstance?.dtInicio&#125;&quot; dateFormat=&quot;%d/%m/%Y %H&#58;%M&quot; showTime=&quot;true&quot; ></calendar&#58;datePicker>
</td>
</tr>

<tr class=&quot;prop&quot;>
<td valign=&quot;top&quot; class=&quot;name&quot;>
<label for=&quot;dtFim&quot;>Fim da Publicação&#58; *</label>
</td>
<td valign=&quot;top&quot; class=&quot;value $&#123;hasErrors(bean&#58;noticiaInstance,field&#58;'dtFim','errors')&#125;&quot;>
<calendar&#58;datePicker name=&quot;dtFim&quot; value=&quot;$&#123;noticiaInstance?.dtFim&#125;&quot; dateFormat=&quot;%d/%m/%Y %H&#58;%M&quot; showTime=&quot;true&quot; ></calendar&#58;datePicker>
</td>
</tr>

</tbody>
</table>
</div>
<div class=&quot;buttons&quot;>
<span class=&quot;button&quot;><g&#58;actionSubmit class=&quot;save&quot; value=&quot;Update&quot; /></span>
<span class=&quot;button&quot;><g&#58;actionSubmit class=&quot;delete&quot; onclick=&quot;return confirm('Are you sure?');&quot; value=&quot;Delete&quot; /></span>
</div>
</g&#58;form>
</div>
</body>
</html>

08/03/2009 00:00


0
Valeu cara!!!
08/03/2009 00:00



Ainda não faz parte da comunidade???

Para se registrar, clique aqui.


Aprenda Groovy e Grails com a Formação itexto!

Newsletter Semana Groovy

Assinar

Envie seu link!


Livro de Grails


/dev/All

Os melhores blogs de TI (e em português) em um único lugar!

 
Creative Commons
RSS Grails Brasil é mantido por itexto Consultoria.
Em caso de problemas contacte Henrique Lobo Weissmann (Kico) por e-mail: kico@itexto.com.br
Todo o conteúdo presente neste site adota o Creative Commons como licença padrão.
Ver: 4.14.0
itexto