You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Elisabeth Adler <el...@gmail.com> on 2010/07/15 13:55:42 UTC

Tapestry - read-only forms

Dear all,

I have an up and running application using tapestry 5.0.19.
Now, a new requirement came up and I have to provide for each form 
(there are about 150 of them) a read-only version.
Is there any simple way of doing this?

Thanks,
Elisabeth

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


Re: Tapestry - read-only forms

Posted by Pablo dos Reis <pa...@gmail.com>.
Hi Elisabeth,

Try to use JavaScript.

Like this:

for(i = 0; i < 150; i++)
   document.forms[0].elements[i].disabled = 1;



2010/7/15 Elisabeth Adler <el...@gmail.com>

> Thanks Uli for the tip - would that mean I have to program a new page
> displaying the bean for every form?
> I was more thinking about somehow iterating through all controls in the
> .tml and disabling them - would that be possible?
> Any ideas appreciated,
> Elisabeth
>
>
> On 15.07.2010 14:02, Ulrich Stärk wrote:
>
>> If it's just about displaying the contents of a bean, have a look at the
>> BeanDisplay component.
>>
>> Uli
>>
>> On 15.07.2010 13:55, Elisabeth Adler wrote:
>>
>>> Dear all,
>>>
>>> I have an up and running application using tapestry 5.0.19.
>>> Now, a new requirement came up and I have to provide for each form
>>> (there are about 150 of them) a read-only version.
>>> Is there any simple way of doing this?
>>>
>>> Thanks,
>>> Elisabeth
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Pablo Henrique dos Reis

Re: Tapestry - read-only forms

Posted by Robert Zeigler <ro...@scazdl.org>.
Your recollection is correct... assuming you actually use the "disabled" component parameter (rather than just manually setting the disabled element attribute, eg, via javascript).

Robert

On Jul 15, 2010, at 7/158:45 AM , Ulrich Stärk wrote:

> Indeed, all form components have a disabled parameter that can be bound to a boolean page property. Bind them all to the same page property and thus control the disabled status of all form elements on that page. IIRC Tapestry will even make sure that values for disabled fields won't get updated, even when a user somehow changes it back to enabled using javascript.
> 
> Uli
> 
> On 15.07.2010 14:52, Elisabeth Adler wrote:
>> Thanks Uli for the tip - would that mean I have to program a new page
>> displaying the bean for every form?
>> I was more thinking about somehow iterating through all controls in the
>> .tml and disabling them - would that be possible?
>> Any ideas appreciated,
>> Elisabeth
>> 
>> On 15.07.2010 14:02, Ulrich Stärk wrote:
>>> If it's just about displaying the contents of a bean, have a look at
>>> the BeanDisplay component.
>>> 
>>> Uli
>>> 
>>> On 15.07.2010 13:55, Elisabeth Adler wrote:
>>>> Dear all,
>>>> 
>>>> I have an up and running application using tapestry 5.0.19.
>>>> Now, a new requirement came up and I have to provide for each form
>>>> (there are about 150 of them) a read-only version.
>>>> Is there any simple way of doing this?
>>>> 
>>>> Thanks,
>>>> Elisabeth
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: Tapestry - read-only forms

Posted by Elisabeth Adler <el...@gmail.com>.
Brilliant, thanks for the help! I'll give that a try:)

On 15.07.2010 15:45, Ulrich Stärk wrote:
> Indeed, all form components have a disabled parameter that can be 
> bound to a boolean page property. Bind them all to the same page 
> property and thus control the disabled status of all form elements on 
> that page. IIRC Tapestry will even make sure that values for disabled 
> fields won't get updated, even when a user somehow changes it back to 
> enabled using javascript.
>
> Uli
>
> On 15.07.2010 14:52, Elisabeth Adler wrote:
>> Thanks Uli for the tip - would that mean I have to program a new page
>> displaying the bean for every form?
>> I was more thinking about somehow iterating through all controls in the
>> .tml and disabling them - would that be possible?
>> Any ideas appreciated,
>> Elisabeth
>>
>> On 15.07.2010 14:02, Ulrich Stärk wrote:
>>> If it's just about displaying the contents of a bean, have a look at
>>> the BeanDisplay component.
>>>
>>> Uli
>>>
>>> On 15.07.2010 13:55, Elisabeth Adler wrote:
>>>> Dear all,
>>>>
>>>> I have an up and running application using tapestry 5.0.19.
>>>> Now, a new requirement came up and I have to provide for each form
>>>> (there are about 150 of them) a read-only version.
>>>> Is there any simple way of doing this?
>>>>
>>>> Thanks,
>>>> Elisabeth
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: Tapestry - read-only forms

Posted by Ulrich Stärk <ul...@spielviel.de>.
Indeed, all form components have a disabled parameter that can be bound to a boolean page property. 
Bind them all to the same page property and thus control the disabled status of all form elements on 
that page. IIRC Tapestry will even make sure that values for disabled fields won't get updated, even 
when a user somehow changes it back to enabled using javascript.

Uli

On 15.07.2010 14:52, Elisabeth Adler wrote:
> Thanks Uli for the tip - would that mean I have to program a new page
> displaying the bean for every form?
> I was more thinking about somehow iterating through all controls in the
> .tml and disabling them - would that be possible?
> Any ideas appreciated,
> Elisabeth
>
> On 15.07.2010 14:02, Ulrich Stärk wrote:
>> If it's just about displaying the contents of a bean, have a look at
>> the BeanDisplay component.
>>
>> Uli
>>
>> On 15.07.2010 13:55, Elisabeth Adler wrote:
>>> Dear all,
>>>
>>> I have an up and running application using tapestry 5.0.19.
>>> Now, a new requirement came up and I have to provide for each form
>>> (there are about 150 of them) a read-only version.
>>> Is there any simple way of doing this?
>>>
>>> Thanks,
>>> Elisabeth
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: Tapestry - read-only forms

Posted by Elisabeth Adler <el...@gmail.com>.
Thanks Uli for the tip - would that mean I have to program a new page 
displaying the bean for every form?
I was more thinking about somehow iterating through all controls in the 
.tml and disabling them - would that be possible?
Any ideas appreciated,
Elisabeth

On 15.07.2010 14:02, Ulrich Stärk wrote:
> If it's just about displaying the contents of a bean, have a look at 
> the BeanDisplay component.
>
> Uli
>
> On 15.07.2010 13:55, Elisabeth Adler wrote:
>> Dear all,
>>
>> I have an up and running application using tapestry 5.0.19.
>> Now, a new requirement came up and I have to provide for each form
>> (there are about 150 of them) a read-only version.
>> Is there any simple way of doing this?
>>
>> Thanks,
>> Elisabeth
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: Tapestry - read-only forms

Posted by Ulrich Stärk <ul...@spielviel.de>.
If it's just about displaying the contents of a bean, have a look at the BeanDisplay component.

Uli

On 15.07.2010 13:55, Elisabeth Adler wrote:
> Dear all,
>
> I have an up and running application using tapestry 5.0.19.
> Now, a new requirement came up and I have to provide for each form
> (there are about 150 of them) a read-only version.
> Is there any simple way of doing this?
>
> Thanks,
> Elisabeth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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