class MyTextField extends TextField {
  onComponentTag(tag) {
    super.onComponentTag(tag);
    if (!enabledInHierarchy()) {
        tag.setName("label");
        tag.removeAttribute("type");
        tag.removeAttribute("value");
        tag.setType(TagType.OPEN);
    }
  }

 void onComponentTagBody(final MarkupStream markupStream, final
ComponentTag openTag) {
     replaceComponentTagBody(markupStream, openTag,
getDefaultModelObjectAsString());
  }
}

-igor

On Fri, Feb 28, 2014 at 11:33 AM, Entropy <[email protected]> wrote:
> Is there a way to have my textfield show as plain text when in a readonly
> mode rather than as a disabled textbox?
>
> Backup question: I can imagine making a panel to do this...having a
> textfield and label and hiding whichever I didn't want, but I would want my
> panel to bind to a textbox in the parent page and replace that tag
> (otherwise I would have two textboxes, right).  How would I go about that?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Show-textfield-as-plaintext-when-disabled-tp4664723.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to