Request scope works fine as long as you don't expect your managed
bean's data to be there on the POST back. Reqest means just that, the
managed bean is created for the life of one request and one request
only. So in your case, your member variables (domainObject) will be
null when you POST your form. t:saveState restores values between
requests by storing variables into the component state and restoring
them on POST of the form.

On 11/30/06, Amit Kushwaha <[EMAIL PROTECTED]> wrote:
Andrew,

Yup, the managed bean was in the session scope.

But why wouldn't it work for a request scope? Cos, all managed beans in
the application are dealing with domain objects. It would ideal to put
some managed beans in just the request scope.

TIA.

Amit


Andrew Robinson wrote:
> Sounds like your managedBean's scope is not what you need. Use session
> scope, Conversation scope (from 3rd parties) or use t:saveState.
>
> On 11/30/06, Amit Kushwaha <[EMAIL PROTECTED]> wrote:
>> Hi.
>>
>> Am trying to set/push in some properties on a domain object in a managed
>> bean from an input form.
>>
>> So on the input form, I got some fields like this,
>>
>> <h:inputText id="someProperty"
>> value="#{managedBean.domainObject.property}"/>
>>
>> And in the managed bean and domain object,
>>
>> class ManagedBean {
>>
>>   private DomainObject domainObject;
>>
>>   public ManagedBean() {
>>     domainObject = new DomainObject();
>>   }
>>
>>   setters/getters...
>>
>> }
>>
>> class DomainObject {
>>
>>   private String property;
>>
>>   setters/getters...
>>
>> }
>>
>> The property doesn't get set. What is missing?
>>
>> If the property in the domain object is moved in to the managed bean and
>> the view changed to,
>>
>> <h:inputText id="someProperty"  value="#{managedBean.property}"/>
>>
>> It works okay. This is using JSF + JSP.
>>
>> TIA.
>>
>> Amit.
>>
>>
>>
>>
>>
>>
>>
>


Reply via email to