You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrea Del Bene <an...@gmail.com> on 2014/03/01 12:35:11 UTC
Re: Show textfield as plaintext when disabled?
Hi, l've tried to do a similar thing a couple of months ago but it was very
tricky and l ended up using a panel with two components (text field and a
label).
You can use methods oncomponenttag and onxomponenttagbody to dynamically
change the tag and the body depending on component status (view or edit)...
Good luck :).
On Feb 28, 2014 8:34 PM, "Entropy" <bl...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Show textfield as plaintext when disabled?
Posted by Chris Snyder <ch...@biologos.org>.
One potential issue: Depending on where you're using the technique, it
could lead to problems. For instance, if you are implementing in-place-edit
functionality on a public-facing page, having a lot of your content in
<input/> tags could make the content invisible to search engines (I'm just
guessing here - it would make sense for search engines to ignore form
content, but I don't know if this is true). Even if search engines aren't a
concern, it's contrary to semantic HTML, and could lead to problems for
non-graphical browsers.
Nevertheless, it's easy, and certainly acceptable for many situations.
Still, I stand by my initial "cludgy" assertion. :-)
-Chris
On Mon, Mar 3, 2014 at 4:04 AM, Stijn de Witt <
Stijn.deWitt@planonsoftware.com> wrote:
> I wouldn't call it cludgy... 'pragmatic' is the word that comes to mind :)
>
> Big advantage of styling the input as regular text instead of completely
> replacing the HTML element is that all other behavior remains as expected.
> The field is still submitted with the form etc.
>
> -Stijn
>
>
> -----Original Message-----
> From: Chris Snyder [mailto:chris.snyder@biologos.org]
> Sent: zaterdag 1 maart 2014 17:54
> To: Wicket users mailing list mailing list
> Subject: Re: Show textfield as plaintext when disabled?
>
> I also ended up going the panel route for this.
>
> An alternative - perhaps a bit cludgy - would be to style the input fields
> as plain text using CSS (remove the border & outline, alter the padding,
> etc.).
>
> -Chris
>
> On Sat, Mar 1, 2014 at 6:35 AM, Andrea Del Bene <an.delbene@gmail.com
> >wrote:
>
> > Hi, l've tried to do a similar thing a couple of months ago but it was
> > very tricky and l ended up using a panel with two components (text
> > field and a label).
> > You can use methods oncomponenttag and onxomponenttagbody to
> > dynamically change the tag and the body depending on component status
> (view or edit)...
> > Good luck :).
> > On Feb 28, 2014 8:34 PM, "Entropy" <bl...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
>
RE: Show textfield as plaintext when disabled?
Posted by Stijn de Witt <St...@planonsoftware.com>.
I wouldn't call it cludgy... 'pragmatic' is the word that comes to mind :)
Big advantage of styling the input as regular text instead of completely replacing the HTML element is that all other behavior remains as expected. The field is still submitted with the form etc.
-Stijn
-----Original Message-----
From: Chris Snyder [mailto:chris.snyder@biologos.org]
Sent: zaterdag 1 maart 2014 17:54
To: Wicket users mailing list mailing list
Subject: Re: Show textfield as plaintext when disabled?
I also ended up going the panel route for this.
An alternative - perhaps a bit cludgy - would be to style the input fields as plain text using CSS (remove the border & outline, alter the padding, etc.).
-Chris
On Sat, Mar 1, 2014 at 6:35 AM, Andrea Del Bene <an...@gmail.com>wrote:
> Hi, l've tried to do a similar thing a couple of months ago but it was
> very tricky and l ended up using a panel with two components (text
> field and a label).
> You can use methods oncomponenttag and onxomponenttagbody to
> dynamically change the tag and the body depending on component status (view or edit)...
> Good luck :).
> On Feb 28, 2014 8:34 PM, "Entropy" <bl...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
Re: Show textfield as plaintext when disabled?
Posted by Chris Snyder <ch...@biologos.org>.
I also ended up going the panel route for this.
An alternative - perhaps a bit cludgy - would be to style the input fields
as plain text using CSS (remove the border & outline, alter the padding,
etc.).
-Chris
On Sat, Mar 1, 2014 at 6:35 AM, Andrea Del Bene <an...@gmail.com>wrote:
> Hi, l've tried to do a similar thing a couple of months ago but it was very
> tricky and l ended up using a panel with two components (text field and a
> label).
> You can use methods oncomponenttag and onxomponenttagbody to dynamically
> change the tag and the body depending on component status (view or edit)...
> Good luck :).
> On Feb 28, 2014 8:34 PM, "Entropy" <bl...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>