aspose file tools*
The moose likes JSF and the fly likes Date and Time as Combo Boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Date and Time as Combo Boxes" Watch "Date and Time as Combo Boxes" New topic
Author

Date and Time as Combo Boxes

Aaron Ong
Greenhorn

Joined: Jan 29, 2009
Posts: 5
I am trying to have 6 Combo Boxes for Date/Time(date, month, year, hours, minutes, seconds) using IBM Rational Software Architect.
I have each combo box's value bond to a bean with GregorianCalendar : #{stockData.stock.intakedt.time.date}. However, I kept receiving "Error testing property 'date' in bean of type null".

Appreciates rapid help; project's due tomorrow.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Aaron Ong wrote:
#{stockData.stock.intakedt.time.date}

"Error testing property 'date' in bean of type null"

intakedt.getTime() returned null.

Just make sure that it doesn't. Instantiate it.
Aaron Ong
Greenhorn

Joined: Jan 29, 2009
Posts: 5
How do I do so?
From the JSP page it is being used, the pagecode or the bean?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Uh, just in the bean where it comes from?

Are you using a visual editor or so? I highly recommend you to stop with that until you understand the autogenerated code and are able to write it yourself without help of the visual editor.
Aaron Ong
Greenhorn

Joined: Jan 29, 2009
Posts: 5
Sorry for being an idiot...
My bean instantiates a class named Stock, which contains all the attributes.

I guess I am...
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
intakedt.getTime() should never return null. That's all. In the bean class behind 'intekedt' you need to instantiate the 'time' property. You can do it in the constructor or already in the instance variable declaration.
Aaron Ong
Greenhorn

Joined: Jan 29, 2009
Posts: 5
Thank you for your time and patience!
Aaron Ong
Greenhorn

Joined: Jan 29, 2009
Posts: 5
Er, another problem although the previous one is solved.
With the 6 combo boxes, and
"public StockData(){
getStock().getIntakedt().setTime(new Date());
}"
in the bean, the page is still not able to do database calls, or maybe even accessing the code behind the button(I'm using JPA).
Am I doing something wrong?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Date and Time as Combo Boxes