Foros de discusión

aui calendar

thumbnail
Thomas Berg, modificado hace 11 años.

aui calendar

Regular Member Mensajes: 131 Fecha de incorporación: 7/09/09 Mensajes recientes
I have used the aui-calendar pretty extensively in Liferay 6.0.5 to "pop-up" a calendar when clicking input elements that are supposed to hold dates.

The below code does not seem to work in Liferay 6.1.0, the calendar is drawn in the top left corner of the browser instead of next to the input element and dates are not set when selecting a date in the calendar. I guess the calendar fails to bind to the input element specified in the attribute "trigger"?

<aui:script use="aui-calendar">
    (new A.Calendar({
       trigger: '#<portlet:namespace />&lt;%= PortletKeys.PARAM_ACTIVATE_DATE %&gt;',
       dateFormat: '%Y-%m-%d',
       setValue: true,
       selectMultipleDates: false
    }).render());
</aui:script>


In the examples at http://deploy.alloyui.com/demos/calendar/ there are no input elements...
I believe my use-case is quite common, hopefully I've just missed something obvious, any thoughts on this would be appreciated

Regards
/ Thomas
thumbnail
Muzakir Khan, modificado hace 11 años.

RE: aui calendar

Regular Member Mensajes: 112 Fecha de incorporación: 15/03/12 Mensajes recientes
Hi Thomas!
I am attaching a Calendar portlet war file that works in 6.1.. Check out if it helps you.

Kind Regards
Khan
thumbnail
Thomas Berg, modificado hace 11 años.

RE: aui calendar

Regular Member Mensajes: 131 Fecha de incorporación: 7/09/09 Mensajes recientes
Hello Muzakir,

Thanks for your example! It does not work exactly like I need it to but it's a good start!

I think it's a shame that Alloy UI no longer provides this functionality, I really believe it to be a common use-case. For me, the simplicity of using the calendar for input fields was what made me start using AUI in the first place. Now, without proper documentation and motives as to why this has been changed, its' simply frustrating. I don't have time to figure this out so I will use some other library instead.

Thanks again for your effort, Muzakir!

Kind regards
/ Thomas
thumbnail
Thomas Berg, modificado hace 11 años.

RE: aui calendar (Respuesta)

Regular Member Mensajes: 131 Fecha de incorporación: 7/09/09 Mensajes recientes
As frustrated as I was, I just could not give up on AUI that easy emoticon

My use-case is covered by using the DatePicker instead of Calendar: http://deploy.alloyui.com/demos/datepicker/
In retrospective, this feels like a natural move. I just wish someone had told me about the change.

EDIT:
For completeness, here's how I achieve the same with aui-datepicker:

(new A.DatePicker({
		trigger: '#trigger1',
		calendar: {
			dateFormat: '%Y-%m-%d',
			selectMultipleDates: false
		},
		setValue: true
	}).render());


Regards
/ Thomas
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: aui calendar

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
I think the issue you've mention seems to be listed in liferay's issue below even though it's been about 2 years ago.
The problem is it not clear which version of aui is being used in a version of liferay. It may help to keep track of liferay issues.

http://issues.liferay.com/browse/AUI-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
thumbnail
Thomas Berg, modificado hace 11 años.

RE: aui calendar

Regular Member Mensajes: 131 Fecha de incorporación: 7/09/09 Mensajes recientes
Thanks Hitoshi,
Great link, it all makes perfect sense! I should have made some more careful investigations before "lashing out" emoticon

I completely agree that it would be great if there was a clearer notion of which version is actually used in a particular build of Liferay.
I'm upgrading from Liferay 6.0.5 and haven't been following the changes in AUI more than checking alloyui.com (from time to time. The documentation on deploy.alloyui.com/api/ does not reflect the latest release. It's a bit hard to figure things out even though the examples are up to date.

I also feel that it's confusing that there are several places for information about AUI:

  • http://alloyui.com (not maintained)
  • alloyui.liferay.com (http://www.liferay.com/community/liferay-projects/alloy-ui/overview)
  • deploy.alloyui.com


The most recent (official) release is still 1.0.1

Hope to see Nate blog about AUI again, I think his posts have been extremely useful in the past.

Regards,
/ Thomas
thumbnail
Laura Liparulo, modificado hace 11 años.

RE: aui calendar

Junior Member Mensajes: 38 Fecha de incorporación: 30/06/12 Mensajes recientes
hi! I'm also trying to make the form with the calendar.. I haven't found a solution with AUI only.. but I've been able to perform the database this way:

<aui:form name="caseForm" action="<%=addCaseURL%>" method="post">
	<aui:fieldset>
		<aui:input name="caseName" label="Case Name" size="45">
			<aui:validator name="required" errorMessage="case-required" />
		</aui:input>
		<aui:select name="volumeId" label="Volume">
			<aui:option value="-1">
				<liferay-ui:message key="Choose volume" />
			</aui:option>
			&lt;%
				for (Volume volume : volumes) {
			%&gt;
			<aui:option value="<%=volume.getVolumeId()%>">
				&lt;%=volume.getVolumeName()%&gt;
			</aui:option>
			&lt;%
				}
			%&gt;
		</aui:select>

		<b>Date Case </b>
		<br>
		<liferay-ui:input-date formName="date" yearRangeStart="1970" yearRangeEnd="2100" yearValue="2010" monthValue="3" dayValue="21" dayParam="d1" monthParam="m1" yearParam="y1" />
		<br>

		<aui:select name="agePatient" label="Patient Age">
			<aui:option value="-1">
				<liferay-ui:message key="Choose age" />
			</aui:option>
			&lt;%
				while (i &lt; 130) {
			%&gt;
			<aui:option value="<%=i++%>">
				&lt;%=i%&gt;
			</aui:option>
			&lt;%
				}
			%&gt;

		</aui:select>

		<aui:input type="textarea" label="notes" rows="10" cols="30" name="notes" />
		<aui:button-row>
			<aui:button type="submit" />
			<aui:button type="cancel" value="Cancel" onClick="<%=cancelURL.toString()%>" />
		</aui:button-row>
	</aui:fieldset>
</aui:form>


Although the date input is not aui, by editing the label "<b> ...</b> " .. the user interface is ok. this way I could fill the row in the database :-)
parameters are like:
formName="date" in liferay-ui
name="notes" in aui

Now the date is always the current one.. it doesn't get the input from the form
thumbnail
Laura Liparulo, modificado hace 11 años.

RE: aui calendar

Junior Member Mensajes: 38 Fecha de incorporación: 30/06/12 Mensajes recientes
I've found a working solution.
you can read my thread : DatePicker AUI/liferayUi
Penny Cooper, modificado hace 11 años.

RE: aui calendar

New Member Mensajes: 2 Fecha de incorporación: 16/07/12 Mensajes recientes
Hello,
Thomas I think now its working riteemoticon