AUIU, Guy's not talking about wanting to repopulate request-scoped
objects using the posted data, but instead is having problems with
components stomping over model objects with a "null" when no data is
posted back for that component.

That is somewhat of a flaw in JSF IMO (or MyFaces at least). When no
value is sent back for an input component, I would expect that the
component would just do nothing during update-model phase. Instead,
however, it currently assigns null to its model property. I'm not sure
whether this behaviour is actually in the spec or not. I do know that in
both MyFaces and Mojarra, a value is always stored into the model during
update-model phase, even when it is not changed, and that the JSF2.0
spec draft explicitly says not to do that.

Guy, as I mentioned in a different reply, setting "readonly" instead of
"disabled" should do what you want; the data is not editable by the user
but does get posted back to the server avoiding this problem completely.

Regards,
Simon

Andrew Robinson schrieb:
> The value hasn't changed, there is no reason to send it back to the
> server. If you have that value in a request scope, it is your job to
> manage the state.
>
> 1) use conversations (seam or orchestra)
> 2) use t:saveState
> 3) use h:inputHidden
>
> -Andrew
>
> On Thu, Apr 24, 2008 at 3:03 PM, Guy Bashan <[EMAIL PROTECTED]> wrote:
>   
>> Thanks,
>>  It seems like the logical behavior, and also consistent with traditional
>>  HTML not passing disabled inputs.
>>  (still, there are cases in which you want to save the value of a disabled
>>  control...)
>>
>>
>>
>>  -----Original Message-----
>>  From: Andrew Robinson [mailto:[EMAIL PROTECTED]
>>  Sent: Thursday, April 24, 2008 11:42 PM
>>  To: MyFaces Discussion
>>  Subject: Re: <h:selectOneMenu> disabled="true" returns "null" submitted
>>  value
>>
>>  Yes and no, disabled HTML controls do not submit values to the server.
>>  So there is no submitted value, not that it is not returning the
>>  submitted value.
>>
>>  On Thu, Apr 24, 2008 at 1:14 PM, Guy Bashan <[EMAIL PROTECTED]> wrote:
>>  > Hi,
>>  >
>>  >  It seems that when <h:selectOneMenue> is disabled, getSubmittedValue (of
>>  >  that selectOneMenu using "binding" property) returns "null" instead of
>>  the
>>  >  submitted value.
>>  >
>>  >  Is it a correct behavior?
>>  >
>>  >  Guy.
>>  >
>>  >
>>
>>
>>     
>
>   

Reply via email to