Hi Milan,

Can you try this in your action class.

if(your condition for setting editable mode is true)
request.setAttribute("edittingMode",true);
else
request.setAttribute("edittingMode",false);


or another way

String edittingMode= "false";
if(your condition for setting editable mode is true)
{
edittingMode = "true";
request.setAttribute("edittingMode",edittingMode );
}
else
{
request.setAttribute("edittingMode",false);
}



I am sure you are already doing that. I think readonly works best on the
textarea and not textfield. try disabled instead of readonly and i am sure
it will work.
See the docs here.

http://struts.apache.org/2.x/docs/textfield.html


Hope it helps.


On Sun, Nov 30, 2008 at 5:10 AM, Milan Milanovic <> wrote:

>
> No one knows how to do this simple thing ?
>
> --
> Milan
>
>
> Milan Milanovic wrote:
> >
> > Hi,
> >
> > I have defined edittingMode (String and boolean, I tried both) in my
> > action class with get/set methods and in resulting jsp I defined:
> >
> > <s:textfield id="id" label="Id" name="id" readonly="%{edittingMode)"/>
> >
> > But if I set edditingMode = "true" or edittingMode = true (in case of
> > boolean), textfield never become readonly! I'm using Struts 2.0.11.1.
> What
> > is the problem ?
> >
> > --
> > Thx, Milan
> >
>
> --
> View this message in context:
> http://www.nabble.com/-S2--Set-textfield-readonly-property-from-action-class-tp20738164p20756552.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to