Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Adam Victor Nazareth Brandizzi
Configuring <aui:input> for date
27 novembre 2011 14.51
Risposta

Adam Victor Nazareth Brandizzi

Punteggio: Junior Member

Messaggi: 67

Data di Iscrizione: 30 aprile 2010

Messaggi recenti

Hello, all!

Suppose I have a model class generated by service builder from this entity:

1    <entity name="Person" local-service="true" remote-service="false">
2        <column name="personId" type="long" primary="true" />
3        <column name="birthday" type="Date" />
4    </entity>


Now, suppose I have such a JSP:

1<%
2    Person person = PersonLocalServiceUtil.getPerson(personId);
3%>
4
5<aui:model-context bean="<%= person %>" model="<%= Person.class %>" />
6<%-- ... --%>
7<aui:input value="birthday" />


The JSP below will generate a datepicker to the <aui:input>, right? This datepicker will also have fields for submitting hour, minutes etc.

My questions are:

  1. How could I remove the fields for time input from the datepicker, leaving only the fields for date input?
  2. How could I make <aui:input> to have the same behavior without using an entity generated by service builder? For example, how can I make <aui:input> to present the datepicker to pick just some standalone date object?


Thanks in advance!
Jelmer Kuperus
RE: Configuring <aui:input> for date
27 novembre 2011 15.36
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1187

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

1. service builder will generate a file called portlet-model-hints.xml, you can use this file to add hints to fields. In your case you will want to add a show-time hint. like this :

1<field name="birthday" type="Date">
2    <hint name="show-time">false</hint>
3</field>


2. aui:input has a type attribute . You can for example do this :

1<aui:input type="checkbox" />


or

1<aui:input type="radio" />


Unfortunately it does not seem you can use this feature for date pickers

You would have to use <liferay-ui:input-date directly i think