Again: please post the full stacktrace and your relevant code, we can
just guess without having more info.
Philippe Lamote wrote:
> Thought of this possibility too.
> That's why I added to the bean constructor the newt line:
> Person loginPerson = new Person("",""); // Dummy init for loginName
> & password
> This ensured that not only Person was != null, but also the 2 fields
> used of Person, on the page. (made a construtor just for this purpose)
>
> This had no effect however.
> Philippe
>
> On 06 Feb 2006, at 13:24, Jana Parvanova wrote:
>
> I had a similar problem - error in conversion for expressions like:
>
> "bean.property1....propertyN.value"
>
> when any property in the chain property1....propertyN was null;
>
> Can you check that your getLoginPerson method returns always != null?
>
> ----- Original Message ----- From: "Philippe Lamote" <[EMAIL PROTECTED]>
> To: "MyFaces Discussion" <[email protected]>
> Sent: Monday, February 06, 2006 1:01 PM
> Subject: Re: Variable Resolver
>
>
>> Yes I did...
>> I'll reconstruct the code, for the moment I have bypassed the prob
>> by having LoginBean extend Person. :-(
>> Originally loginPerson(the field itself) itself was private, made it
>> public just in case, but that didn't change anything.
>> I have also googled for this (perhaps with the wrong terms, like
>> "JSF and recursive variable resolving") but that didn't came up
>> with much. :-)
>> What I don't know is whether the Variabe Resolver was specified to
>> also resolve in that fashion in the first place.
>> What I also tried was to make the model.Person class a (managed)
>> bean to see whether that would make a diff, but it didn't.
>> Philippe
>> On 06 Feb 2006, at 11:49, Volker Weber wrote:
>> Hi Philippe,
>> did you have public getter and setter for Person in loginBean?
>> the expression #{loginbean.loginPerson.lastName} is resoved to
>> "loginbean.getLoginPerson().getLastName()"
>> where loginBean is the object from session scope.
>> otherwise please post the stacktrace and more of your relevant code.
>> Regards,
>> Volker
>> Philippe Lamote wrote:
>>
>>> Hi,
>>>
>>> I have a Variable Resolver question.
>>> To set the scene first:
>>>
>>> Trying to follow good practice, I build up my model classes in
>>> "XXX.model.modelClass". e.g. "XXX.model.Person"
>>> For the front end, there's a package "XXX.web.beans" e.g.
>>> "XXX.web.beans.LoginBean"
>>>
>>> & In that LoginBean I had a field declared:
>>> "Person loginPerson;"
>>>
>>> --> In the JSF page I obviously tried:
>>> Login: #{loginbean.loginPerson.lastName} (I declared "loginbean"
>>> properly in the faces-config, session scope)
>>>
>>> Yet this continues to give me errors. (of type conversion/validation
>>> "while updating model")
>>>
>>> Which made me wonder whether the Variable Resolver was made for this
>>> sort of schemas after all?
>>> If not that would be a pitty I think.
>>>
>>> I made it work by having LoginBean extend Person but qua design I
>>> think
>>> this is much less elegant.
>>> (but still way better than copy all fields again in front-end
>>> classes -
>>> why make a model then?!)
>>>
>>> Philippe
>>>
>>>
>> --
>> Don't answer to From: address!
>> Mail to this account are droped if not recieved via mailinglist.
>> To contact me direct create the mail address by
>> concatenating my forename to my senders domain.
>>
>
--
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.