Yeah, sorry about that. I committed a fix for this. Added method
protected void onDisabled(final ComponentTag tag) to FormComponent,
which is called during rendering when the component is disabled. By
default, an disabled="disabled" attribute is added, but clients may
override this method. In your case, you would do something like:

new TextField("myid", myModel) {
  protected void onDisabled(ComponentTag tag) {
    tag.put("read-only", "true");
  }
}

Don't call super, or you'll still have the disabled attribute added.
Btw, it doesn't work with a attribute modifier anymore - like Matej
already changed for 2.0 - which is more efficient too.

The read-only attributes are available for text fields and text areas,
but it wouldn't make a good default for Wicket because they will still
be part of form submission (see
http://www.w3.org/TR/html4/interact/forms.html#h-17.12), and could be
changed using Javascript. Could you give this spin a change, and see
whether this gives you problems with Wicket denying updates?

Cheers,

Eelco


On 10/20/06, ChuckDeal <[EMAIL PROTECTED]> wrote:
>
> That actually happens via some other code that I snipped.  But because
> TextArea (specifically FormComponent) also puts the disabled attribute, I
> need to make sure that the disabled attribute gets removed prior to
> rendering because even though I put the readonly attribute on it, the
> disabled attribute still causes the problem.  Thats what my TextAreaFixer
> does, disables the DisabledAttributeModifer from FormComponent.
>
>
> Frank Bille wrote:
> >
> > On 10/20/06, ChuckDeal <[EMAIL PROTECTED]> wrote:
> >>
> >> Then to use it, in my code:
> >>
> >> TextArea description = new TextArea("description");
> >> add(description);
> >> TextAreaFixer.updateTextArea(description);
> >>
> >> Is ther a better way to do what I am trying to accomplish?
> >>
> >
> > I'm not sure what it is that you want but can't you just say:
> >
> > textArea.add(new SimpleAttributeModifier("readonly", "readonly"));
> >
> > -------------------------------------------------------------------------
> > 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
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/enable-remove-added-behaviors-tf2479810.html#a6915275
> 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
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to