You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephan Windmüller <st...@cs.tu-dortmund.de> on 2010/07/12 14:35:19 UTC

Using readonly textarea inside a Form component

Hello!

I am trying to use a read-only textarea component inside a form
component. When the form is submitted, I get this error:

org.apache.tapestry5.runtime.ComponentEventException: Failure writing
parameter 'value' of component xxx.textarea: Binding
org.apache.tapestry5.internal.services.AttributeExpansionBinding@ce988a
is read-only.

Is it possbible to mark the component itself as read-only? Setting
t:disabled="true" works but the textarea is rendered differently.

Regards
 Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Using readonly textarea inside a Form component

Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
On 12.07.2010 14:54, Benny Law wrote:

> Or, if you really want the textarea to be readonly (vs disabled), just add
> the readonly="readonly" attribute. This allows the user to set focus to it
> and copy content from it but not change the content, and it doesn't get the
> disabled appearance.

This was my first try but it prevents the form from being submitted.

- Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Using readonly textarea inside a Form component

Posted by Benny Law <be...@gmail.com>.
Or, if you really want the textarea to be readonly (vs disabled), just add
the readonly="readonly" attribute. This allows the user to set focus to it
and copy content from it but not change the content, and it doesn't get the
disabled appearance.

Benny

On Mon, Jul 12, 2010 at 8:46 AM, Christophe Cordenier <
christophe.cordenier@gmail.com> wrote:

> Hi
>
> AFAIR Tapestry simply append 'disabled' in the generated markup. Using CSS
> to stylize .disabled should to the trick.
>
> 2010/7/12 Stephan Windmüller <st...@cs.tu-dortmund.de>
>
> > Hello!
> >
> > I am trying to use a read-only textarea component inside a form
> > component. When the form is submitted, I get this error:
> >
> > org.apache.tapestry5.runtime.ComponentEventException: Failure writing
> > parameter 'value' of component xxx.textarea: Binding
> > org.apache.tapestry5.internal.services.AttributeExpansionBinding@ce988a
> > is read-only.
> >
> > Is it possbible to mark the component itself as read-only? Setting
> > t:disabled="true" works but the textarea is rendered differently.
> >
> > Regards
> >  Stephan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Regards,
> Christophe Cordenier.
>
> Committer on Apache Tapestry 5
> Co-creator of wooki @wookicentral.com
>

Re: Using readonly textarea inside a Form component

Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
On 12.07.2010 15:43, Christophe Cordenier wrote:

> What if you use a plain html textarea with readonly attribute instead of a
> div ?

This works, thank you!

- Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Using readonly textarea inside a Form component

Posted by Christophe Cordenier <ch...@gmail.com>.
What if you use a plain html textarea with readonly attribute instead of a
div ?

2010/7/12 Stephan Windmüller <st...@cs.tu-dortmund.de>

> Am 12.07.2010 15:09, schrieb Christophe Cordenier:
>
> > Maybe you can create a new component that displays your text in a div and
> > use a disable/invisible textfield.
>
> For this I have to parse the text and convert it to HTML: Special
> characters, newlines etc.
>
> - Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Using readonly textarea inside a Form component

Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
Am 12.07.2010 15:09, schrieb Christophe Cordenier:

> Maybe you can create a new component that displays your text in a div and
> use a disable/invisible textfield.

For this I have to parse the text and convert it to HTML: Special
characters, newlines etc.

- Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Using readonly textarea inside a Form component

Posted by Christophe Cordenier <ch...@gmail.com>.
Hi

Maybe you can create a new component that displays your text in a div and
use a disable/invisible textfield.

So your field is secure, and you let the possibility for the user to
copy/paste the text.

2010/7/12 Stephan Windmüller <st...@cs.tu-dortmund.de>

> On 12.07.2010 14:46, Christophe Cordenier wrote:
>
> >> Is it possbible to mark the component itself as read-only? Setting
> >> t:disabled="true" works but the textarea is rendered differently.
> > AFAIR Tapestry simply append 'disabled' in the generated markup. Using
> > CSS to stylize .disabled should to the trick.
>
> Thanks for your reply. "disable" does more than changing the style:
> Users are unable to interact with the text, like copying. I want the
> users to be able to do this.
>
> Regards
>  Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Using readonly textarea inside a Form component

Posted by Stephan Windmüller <st...@cs.tu-dortmund.de>.
On 12.07.2010 14:46, Christophe Cordenier wrote:

>> Is it possbible to mark the component itself as read-only? Setting
>> t:disabled="true" works but the textarea is rendered differently.
> AFAIR Tapestry simply append 'disabled' in the generated markup. Using
> CSS to stylize .disabled should to the trick.

Thanks for your reply. "disable" does more than changing the style:
Users are unable to interact with the text, like copying. I want the
users to be able to do this.

Regards
 Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Using readonly textarea inside a Form component

Posted by Christophe Cordenier <ch...@gmail.com>.
Hi

AFAIR Tapestry simply append 'disabled' in the generated markup. Using CSS
to stylize .disabled should to the trick.

2010/7/12 Stephan Windmüller <st...@cs.tu-dortmund.de>

> Hello!
>
> I am trying to use a read-only textarea component inside a form
> component. When the form is submitted, I get this error:
>
> org.apache.tapestry5.runtime.ComponentEventException: Failure writing
> parameter 'value' of component xxx.textarea: Binding
> org.apache.tapestry5.internal.services.AttributeExpansionBinding@ce988a
> is read-only.
>
> Is it possbible to mark the component itself as read-only? Setting
> t:disabled="true" works but the textarea is rendered differently.
>
> Regards
>  Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com