I looked through the forum but couldn't quite find something close to the case that I'm running into. Forgive me if this was already answered and I just missed a post.
We are using Tapestry 5.2 with Hibernate and the codebase has remnants of pre-5.2 Tapestry code where we needed to directly access SelectModelImpl. If I recall correctly the SelectModelFactory was added in 5.2. I have a case where I needed to pull information from our DB via hibernate via a Criteria query. I then get back a list of Objects I'll call Role for this example. Role, as an entity, consists of a number of different properties, one being "name". For each Role, I add to a list of OptionModel using role.getName() for the label and passing the Role object as the second parameter in the OptionModelImpl constructor. I tried to use selectModelFactory.create(options, "name"), where the first parameter is my list of options and my second parameter is the desired label. However, when I debug into the code, I get an NPE at this line in the SelectModelFactory: final PropertyAdapter propertyAdapter = classPropertyAdapter.getPropertyAdapter(labelProperty); Where I'm assuming labelProperty == "name". When the next line is called, it throws an NPE because the propertyAdapter is not created (it's null). Do I need to refer to this property in some other way for it to understand what it needs? As a word of caution, my knowledge of Tapestry starts about 2 months ago, so I'm hoping that this description is clear. As another side note, when I just call the internal class constructor ( new SelectModelImpl(null,options), I get a model object successfully returned. I would much much much rather use the SelectModelFactory if I can get it to work. Thanks! Melanie -- View this message in context: http://tapestry.1045711.n5.nabble.com/Another-question-about-using-SelectModelFactory-tp5716793.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
