Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF and javscript  RSS feed

 
Aneek kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am new to JSF. I am using primefaces component to display date and then I am using javascript code to get month from this date but it returns NaN? Here is my code:



<h:form prependId="false">
<p:outputLabel value="Schedule Date" for="scheduleDate" />
<p:calendar id="scheduleDate" pattern="MM/dd/yyyy" value="#{assetScheduleHeaderController.selected.scheduleDate}" title="scheduleDate" showOn="button" onclick="finyear();"/>

}


I tried this with getMonth() function as well but nothing happens. Can anyone guide me please? I have been trying to fix this since two days.Thanks in advance
 
Aneek kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aneek kumar wrote:Hi
I am new to JSF. I am using primefaces component to display date and then I am using javascript code to get month from this date but it returns NaN? Here is my code:



<h:form prependId="false">
<p:outputLabel value="Schedule Date" for="scheduleDate" />
<p:calendar id="scheduleDate" pattern="MM/dd/yyyy" value="#{assetScheduleHeaderController.selected.scheduleDate}" title="scheduleDate" showOn="button" onclick="finyear();"/>

}


I tried this with getMonth() function as well but nothing happens. Can anyone guide me please? I have been trying to fix this since two days.Thanks in advance. Any help will be highly highly appreciated !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!