myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rene Guenther" <innflow-guent...@innflow.com>
Subject Re: General JSF question -- Class object!
Date Tue, 31 Oct 2006 14:48:46 GMT
It would maybe help to initialize firstChoice:
Course firstChoice = new Course()

JSF tries to set the value title of firstChoice by 
calling:

firstChoice.setTitle(title)

Of course this is not possible if firstChoice == null. 
Under these circumstances you get the error which you 
described. If firstChoice != null you can save the state 
of firstChoice with the saveState tag <t:saveState 
value="#{applicant.firstChoice}" />

Regards
René

On Tue, 31 Oct 2006 22:42:23 +0800
  "Damar Thapa" <thapa.damar@gmail.com> wrote:
> Hi Rene,
> 
> Possibly, it is null. I am still getting ""firstChoice": 
>Error during
> model data update." error.  I can add two more attribues 
>of type
> String to hold firstChoice and secondChoice in Applicant 
>class, but as
> a matter of interest and learning, how it works in JSF?
> 
> Thanks,
> 
> Damar
> 
> 
> 
> 
> 
> 
> n 10/31/06, Rene Guenther <innflow-guenther@innflow.com> 
>wrote:
>> Is firstChoice != null?
>>
>> Regards
>> Rene
>>
>> On Tue, 31 Oct 2006 20:32:40 +0800
>>  "Damar Thapa" <thapa.damar@gmail.com> wrote:
>> > Hi,
>> >
>> > I have following classes:
>> >
>> > Class Course(
>> >       String title,
>> >       String startDate.
>> >       …..
>> >       ….
>> >
>> > }
>> >
>> > and
>> >
>> > Class Apply{
>> >
>> > String studnetName;
>> > Course firstChoice;
>> > .....
>> > …….
>> > …..
>> > }
>> >
>> > In the apply form (page), I havae a field to accept
>> >course title from
>> > the applicant  ie <h:inputText id="firstChoice"
>> > value="#{applicant.firstChoice.title}"/>. Since title 
>>is
>> >unique, I can
>> > retrieve Course object for firstChoice properties 
>>later
>> >before saving
>> > Apply object. But, I am getting ""firstChoice": Error
>> >during model
>> > data update." error on "#{applicant.firstChoice.title} 
>>.
>> >Can somebody
>> > on the list point me what am I missing?
>> >
>> > Any pointers would be highly appreciated.
>> >
>> > Thanks,
>> >
>> > Damar
>>
>>
> 
> 
> -- 
> With regards,
> 
> Damar Thapa


Mime
View raw message