it is not enough to enable the select box only on the client site.
because if you render a select component with disabled="true"
tapestry wont even "register" the necessary event handler to 
process the submission.

in tapestry 5 words: no ProcessSubmission component 
event will be serialized into the form thus no values will be 
processed. :)  (see Select->AbstractField component source code)

i see two possibilities: as mentiond by andy do everything on the
client side or do a ajax request (zone) updatind the select component
with disabled="false".

g,
kris





Andy Pahne <[EMAIL PROTECTED]> 
30.09.2008 15:45
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
Tapestry users <users@tapestry.apache.org>
Kopie

Thema
Re: T5: t:select how to disable and re-enable








Maybe it's possible that you disable your select only clientside?
If you do so there won't be any problems if you later on enable it again.

Andy


Russell Brown schrieb:
> Hi,
> I am using a T5 select component. When the form renders I wish the 
select to be disabled so I use disabled="true" parameter. However, some 
javascript causes the field to become enabled. If this happens however the 
value selected does not get sent into the property of the component. I am 
assuming this is thanks to the "feature" decribed here 
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Select.html
 
thussly : 
> 
> "If true, then the field will render out with a disabled attribute (to 
turn off client-side behavior). Further, a disabled field ignores any 
value in the request when the form is submitted. "
> 
> So how to set the select value to disabled initially but not make it 
stay that way for ever?
> 
> Thanks in advance for your ideas, I have resorted to adding a little 
javascript that sets it so on load but that is a bit of hack for some 
fairly simple functionality.
> 
> Any reason WHY "Further, a disabled field ignores any value in the 
request when the form is submitted." this seems to offer zero advantage 
and loads of problems
> 
> Cheers
> 
> Russell

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to