This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date and Time as Combo Boxes

 
Aaron Ong
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I do so?
From the JSP page it is being used, the pagecode or the bean?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your time and patience!
 
Aaron Ong
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic