Fórum

Javascript and Alloy UI calendars

DJ Spiess, modificado 12 Anos atrás.

Javascript and Alloy UI calendars

New Member Postagens: 8 Data de Entrada: 15/10/09 Postagens Recentes
Hi,

I'm new to Liferay, and I'm having troubles with the Calendar tag. I've defined two calendar objects in Liferay, and I'd like to update the dates when someone selects a link. The code below is what I'm using:

  <aui:column>
	    <aui:input name="startDate" model="<%= MappingPortletBean.class %>" bean="<%=userSelections %>" value="<%= startCal %>" />
	    <aui:input name="endDate" model="<%= MappingPortletBean.class %>" bean="<%=userSelections %>" value="<%= endCal %>" />
	    <a href="<%= &quot;javascript:&quot; + renderResponse.getNamespace() + &quot;_updateLast7Days();&quot; %>">Last 7 days</a> 
	    | <a href="<%= &quot;javascript:&quot; + renderResponse.getNamespace() + &quot;_updateMonthToDate();&quot; %>">Month to date</a> 
	    | <a href="<%= &quot;javascript:&quot; + renderResponse.getNamespace() + &quot;_updateYearToDate();&quot; %>">Year to date</a> 
	    | <a href="<%= &quot;javascript:&quot; + renderResponse.getNamespace() + &quot;_updatePreviousMonth();&quot; %>">Previous Month</a>
	</aui:column>


In the above example next to the calendar controls, I have links for Last 7 Days, Month to Date, etc. When someone clicks "Last 7 Days", I'd like to update the dates in the controls. I can update each rendered control by it's name for the day, month and year, but it seems that there has to be an easier way.

Thanks,
DJ Spiess