I made a slight error
readonly="%{fullAccess}" with s:textfield does not work but
<input type="text" name="description" id="description" <s:if
test="!fullAccess">readonly="true"</s:if> />
works.
On Thu, Mar 13, 2008 at 10:48 AM, Richard Sayre <[EMAIL PROTECTED]> wrote:
> If the disable attribute is present in a HTML tag it will be disable,
> no matter what the value of the attribute is.
>
> So if I have a s:select and I say disabled="false" it will be
> disabled (renders disabled="disabled").
>
> But if we have a text, and we set readonly="false" it will not be editable.
>
> On my page my action determines my users access level - fullAccess
> (user can edit anything) or partialAccess (user can edit certian
> fields but see the other fields)
>
> I have a text field set up like this s:textfield
> readonly="%{fullAccess}". which works fine.
>
> But s:select disabled="%{fullAccess}" does not work.
>
> I tried this <s:select <s:if test="!fullAccess">disabled="true"</sif>
> /> But the s:if tag is causing a syntax error.
>
> The only solution I came up with was
>
> <s:if test="!fullAccess">
> <s:select disabed="true" .......
> </s:if>
> <s:else>
> <s:select .......
> </s:else>
>
> So I have 2 s:selects and s:radios for every radio/select
>
> I would prefer to have it like the textfields so I dont have to have 2
> pieces of code for each select and radio.
>
> I figured i could do an <if> around a <script> block at the bottom of
> the page and disable them with javascript but that might be a little
> confusing for future coders who have to work on this.
>
> Can anyone think of a good way to achieve this?
>
> Thanks,
>
> Rich
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]