We have the same kind of requirements for our app.  We use the setEnabled
method of FormComponent to mark a field as disabled (setEnabled(false)),
then when it is rendered, it defaults to having the disabled attribute added
to the field.  The only problem that we have noticed is that TextArea does
not work as we would like it when disabled because it becomes unscrollable,
instead we override the onDisabled() method of TextArea to set the readonly
attribute as well as a css style attribute ("color: GrayText;") to make it
appear disabled.

Chuck


Erik Brakkee-3 wrote:
> 
> Hi,
> 
> 
> In my application I have the situation that when an object reaches a
> certain state, it can no longer be modified or in some cases only
> parts of the entities state may be modified.
> 
> As a result, what I need is a method of easily creating read-only
> versions of a form where some or all fields have become read only. I
> want to do this without duplicating information so a solution where I
> create a read-only version and a read-write version for the same
> entity is not really a solution for me.
> 
> Of course, I could always roll my own by defining a special panel for
> every basic form component, such as:
> 
>     <wicket:panel>
>        <span wicket:id="readonly">Label here</span>
>        <input type="text" wicket:id="readwrite"></input>
>     </wicket:panel>
> 
> and then enabling only one of these components depending on the context.
> 
> Is there already a standard solution for this somewhere?
> 
> Cheers
>   Erik
> 
-- 
View this message in context: 
http://www.nabble.com/Read-write-versus-read-only-versions-of-a-form...-tf2583741.html#a7222587
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to