Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marco Napolitano
<aui:input> and null date
December 17, 2012 4:13 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Hi all,
I'm using LR 6.1.1 CE and I have an entity with a Date field (called closedDate).
The field is not required and it's defined with this model hints:
 1<hint-collection name="SEARCHABLE-DATE">
 2    <hint name="month-nullable">true</hint>
 3    <hint name="day-nullable">true</hint>
 4    <hint name="year-nullable">true</hint>
 5    <hint name="show-time">false</hint>
 6</hint-collection>
 7<field name="closedDate" type="Date">
 8    <hint-collection name="SEARCHABLE-DATE" />
 9</field>

The field is not required so it's almost always null. But if I render the value with this Alloy taglib (I'm correctly using the model-context tag)
1<aui:input name="closedDate" />

the null value is not correctly rendered and the taglib always show now-date.

How can I show a null date?
I mean the 3 combo (day, month and year) must be preselected on empty value.

Tnx
Marco
Brian Jamieson
RE: <aui:input> and null date
December 17, 2012 10:42 AM
Answer

Brian Jamieson

Rank: Junior Member

Posts: 51

Join Date: October 15, 2010

Recent Posts

Hi Marco,

I've hit the same problem in a couple of different places in my application too.

How Liferay deals with it in the web content schedule is like so:

Create the datefields, but also create a toggle function to disable the field - when the article is submitted, the disabled field values do not get passed through.

Look at liferay/src/Lportal611/portal-web/docroot/html/portlet/journal/article/schedule.jsp for more details.

Hope this helps, good luck.

Brian
Marco Napolitano
RE: <aui:input> and null date
December 18, 2012 12:50 AM
Answer

Marco Napolitano

Rank: New Member

Posts: 19

Join Date: February 14, 2012

Recent Posts

Yeah,
I always did with a checkbox but I'd like to know an alternative way to do that. emoticon

Tnx
Marco