Posts

Showing posts with the label calendar

Working with Alloy UI Taglibs

Image
We can use readly avalible taglibs in our customportlet , Here are the some 1. If we want user to rate the content we can use "ratings" taglib as, <liferay-ui:ratings classPK="12724" className="<%=BlogsEntry.class.getName() %>"></liferay-ui:ratings> Here classPK is the  primarykey , here i am using the blogsentry so it is blogsentryid className is the classname of the entry, wheather it is "BlogsEntry" , "JournalArticle" etc. 2. If we want to display the rating score <liferay-ui:ratings-score score="2"></liferay-ui:ratings-score> 3. "Discussion" taglib mostly used to display the user comments <liferay-ui:discussion classPK="12724" userId="10201" className="<%=BlogsEntry.class.getName() %>" formAction="fm"></liferay-ui:discussion> Here classPK is the  primarykey , here i am using the blogsentry so it is...

Date Picker in liferay

Image
In Liferay it is simple to add the add the DatePicker. Liferay already had datepicker taglib, so here we go . Creating the calendar object, for today date. Calendar cal = CalendarFactoryUtil.getCalendar(timeZone, locale); int startDateValue = cal.get(Calendar.DATE); int startMonthValue = cal.get(Calendar.MONTH); int startYearValue = cal.get(Calendar.YEAR); Implementing the date picker, <aui:fieldset> <aui:field-wrapper label="start-date"> </aui:field-wrapper></aui:fieldset> <div class="field-row"> <liferay-ui:input-date dayparam="schedulerStartDateDay" dayvalue="&lt;%=startDateValue %&gt;" disabled="&lt;%= false %&gt;" monthparam="schedulerStartDateMonth" monthvalue="&lt;%=startMonthValue%&gt;" name="startDate" yearparam="schedulerStartDateYear" yearvalue="&lt;%=startYearValue%&gt;"> </liferay-u...