Foros de discusión

LIferay, AUI datepicker is not working

thumbnail
Chandan Sharma, modificado hace 9 años.

LIferay, AUI datepicker is not working

Junior Member Mensajes: 54 Fecha de incorporación: 4/03/14 Mensajes recientes
Hi Experts,

I am trying to use Liferay/AUI datepicker in my portlet. It is coming perfectly when I am accessing the jsp as popup, but while accessing directly inside my "view.jsp" then it is coming but not allowing me to perform any action like selecting the date.

Based on my observation it is going behind my theme. So because of that even if it is rendering but not allowing me to select.

Here is my sample code for date-picker


<aui:input name="taskStartDate" autocomplete="off" cssClass="font-size" value="<%=est_start_date%>" id="taskStartDate" onblur="validateDate(this, 'estStartDateMsg')" required="true" inlineLabel="true" label=" " onClick="onClickOfStartDate();" onkeypress="return isDateKey(event);" />	

<aui:script>
function  setactualStartDate(){
     
  AUI().use('aui-datepicker', function(A) {
      var simpleDatepicker1 = new A.DatePicker({
        trigger: '#<portlet:namespace />taskActualStartDate', 
         mask: '%Y-%m-%d',
          calendar: {
            dateFormat: '%Y-%m-%d',
        },
      }).render('##<portlet:namespace />taskactualStartDatePicker');
   });
}

function onClickOfStartDate(){
    setStartDate();
}
</aui:script>

Note: I had tried to put some z-index but still, I didn't succeeded to fulfill my requirement.

Can any body will help me!!!

Thanks,
~Chandan
thumbnail
Vilmos Papp, modificado hace 9 años.

RE: LIferay, AUI datepicker is not working

Liferay Master Mensajes: 529 Fecha de incorporación: 21/10/10 Mensajes recientes
I think perhaps you should put the method in a Liferay.provide() something like this:


<aui:script>
	Liferay.provide(
		window,
		'<portlet:namespace />saveConfiguration',
		function() {
			if (document.<portlet:namespace />fm.<portlet:namespace />assetVocabularyIds) {
				document.<portlet:namespace />fm.<portlet:namespace />assetVocabularyIds.value = Liferay.Util.listSelect(document.<portlet:namespace />fm.<portlet:namespace />currentAssetVocabularyIds);
			}

			submitForm(document.<portlet:namespace />fm);
		},
		['liferay-util-list-fields']
	);
</aui:script>


Please note, that <aui:script> shouldn't have a use='' argument, ortherwise it won't behave as a normal <script> tag, but will do lazy loading of the plugins.