The scope of my backing bean was SESSION, so I don't see how that could
have caused my issue.

I am satisfied with the explanation that my control was readonly=true
and that meant the data was not included when the form was submitted.
Actually I am pretty sure that was the reason because once I made
readonly=false, everything worked as expected. The question of the
editable calendar (with readonly=true) still remains open, but for me it
is no longer an issue because I actually want it to be editable.

Regards,
Usman 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 07, 2008 9:05 AM
To: MyFaces Discussion
Subject: Re: inputCalendar not saving value into backing bean

Yes, that is a common mistake. But it doesn't appear to be the problem
in this particular case. There is data in the input field that is not
getting pushed to the backing bean, yet the data from the drop-down list
component is.

The problem appears to be that Usman was setting readonly=true on the
calendar components.

What made things more confusing is that there appears to be a bug in the
t:inputCalender where in at least some situations the calendar appears
to be editable even though readonly is set to true. I can't duplicate
that , but it may only happen for some browsers or OSes or similar.

Regards,
Simon

MACatwork schrieb:
> Have you got the correct scope on your backing bean data?
> If the bean is reset to the initial value, this is often because it is

> a new instance of the bean.
> If the bean has only request scope, the bean when you look at the 
> value may not be the same instance of the bean where you set the
value.
>
>
>
> Malik, Usman wrote:
>   
>> Hi,
>>
>> I have a simple form with a drop-down list (storeNum), couple of 
>> inputCalendar fields (minDate and maxDate) and a submit button. All 3

>> controls are tied to a backing bean ... the drop-down list is tied to

>> a String variable and the 2 calendar fields are tied to Date 
>> variables (all have getter/setter methods). All 3 controls are set to

>> some initial value that I set in the backing bean programmatically. I

>> also have a submit button in the form that has its action set to a 
>> function in the same backing bean as above. The function returns a 
>> blank string at the end, so after all the processing the JSF 
>> navaigation should re-load the same page.
>>
>> I am still a newbie at JSF but I believe that when I click the submit

>> button, all the tied variables in the backing bean should be updated 
>> with the latest on-screen values, and then the action function should

>> be executed. Inside the action function, I simply check the values of

>> all my tied variables (storeNum, minDate, maxDate) before returning 
>> an empty string. The problem I am running into is that if I change 
>> any of the dates on-screen, they are not updated in the backing bean 
>> when I interrogate them in the action function. However, the storeNum

>> variable IS updated correctly when I interrogate it in the action
function.
>>
>> Is the problem just in my understanding of the JSF model or something

>> else is at play here? Any help would be much appreciated. Btw, I have

>> tried the relevant example at Irian 
>> [http://www.irian.at/myfacesexamples/calendar.jsf] and if I add an 
>> action function and interrogate the date values, they are having the 
>> same problem in that example too!
>>
>> - Usman
>>     
>

NOTE: The information in this email may be confidential and legally
privileged. If you are not the intended recipient, you must not
read, use or disseminate the information; please advise the sender
immediately by reply email and delete this message and any
attachments without retaining a copy. Although this email and any
attachments are believed to be free of any virus or other defect
that may affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by RGIS, LLC for
any loss or damage arising in any way from its use.

Reply via email to