[jboss-user] [JBoss Seam] - dateformat not working?

hhf8 do-not-reply at jboss.com
Fri May 25 12:31:56 EDT 2007


Hi all,
I seem to have an issue with the selectDate tag,when i specify it with the dateformat as dd/mm/yyyy. It works when i submit the entry to  my DB,

however  then it reverts to mm/dd/yyyy. Has anyone any idea why this is?


  | 	<s:selectDate for="selectedDate" value ="#{entryBrowser.selectedDate}"
  | 				dateFormat = "dd/MM/yyyy">
  | 				
  | 	<h:graphicImage url="img/dtpick.gif" style="margin-left:10px"/>
  | 				</s:selectDate>
  | 


  | 	<div class="entry">
  | 				<div class="label"> </div>
  | 				<div class="input">
  | 			        <h:commandButton id="confirm" value="Confirm" action="#{entryConfirm.confirm}"/> 	
  | 				 <h:commandButton id="populate" value="Populate" action="#{entryList.getEntries}"/> 	
  | 				</div>
  | 			</div>
  | 		</h:form>
  | 


  | 	public void confirm()
  | 	{
  | 		log.info("outside try block");
  | 		System.out.println("inside try block");
  |         Entry tempEntry = new Entry(user.getUsername());
  |         tempEntry.setStartdate(entryBrowser.getSelectedDate());
  |         tempEntry.setPriority(calen.getPriority());
  |         tempEntry.setStartHour(calen.getStartHour());
  |         tempEntry.setDesc(calen.getDesc());
  |         tempEntry.setPriority(calen.getPriority());
  | 		  
  |         try
  |         {
  |         	em.persist(tempEntry);
  |         	//em.flush();
  |         }
  |         catch(Exception e) {log.info("The Entity Manager Encountered an Error");}
  | 	   
  |         facesMessages.add("Thank you, #{user.name}, Entry was a success.");
  |         log.info("New entry for #{user.username}");
  |    }
  | 


  |    @Factory("entries")
  |    @Observer("entryConfirmed")
  |    public void getEntries()
  |    { 	  
  | 	  System.out.println(entryBrowser.getSelectedDate().toString()); 
  | 	  if(searchByDate)
  | 	  {
  | 	      entries = em.createQuery("select e from Entry e where e.username = :username " +
  | 	      		"and e.startdate = :searchDate order by e.startHour")
  | 	            .setParameter("username", user.getUsername())
  | 	            .setParameter("searchDate", entryBrowser.getSelectedDate())
  | 	            .getResultList();
  | 	  }
  |    }
  |    

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048739#4048739

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048739



More information about the jboss-user mailing list