• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Date and Time as Combo Boxes

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your time and patience!
 
Aaron Ong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic