Jelena Jovanovic wrote: > Hello, > > I have a problem with the Palette component. I keep receiving > NullPointerException and the stack trace as follows: <edited /> > > I did not make the model persistent since it should be filed with a new set > of values each time the page is presented to the user. > > > If I try to submit the form without making any selection in the Palette > component, everything is fine. However, if I make a selection and then > submit the page I get the exception and the stack trace presented above. > > > > Can anyone give some advice? I really do not have ideas how to solve this > problem.
Sounds like your model is null after you submit. How/when is your model being instantiated? If, for example, you are setting the topicsModel from a listener method before activating the page, then when you submit the form, the model is not re-instantiated, and since it isn't persistent, the property is null (hence your null pointer exception). The reason it works fine when you don't select anything is because, since nothing is selected, the model is never accessed. You mentioned that the available selections should be regenerated on each view of the page, since it changes. One possibility is that if your model is serializable, you could store it in a @Hidden field before the palette component reference, which would ensure that the property is available before render. Otherwise, you could store the criterion used to generate the model in a hidden field, and then define a listener method for the @Hidden component to call that re-instantiates the model. There are various other possibilities. Robert > > Thanks in advance! > > Jelena > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
