struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Milanovic <milanmilanov...@yahoo.com>
Subject Re: [S2] Set textfield readonly property from action class
Date Sun, 30 Nov 2008 13:21:54 GMT

Dear Khawaja,

Thanks. I tried with Boolean too for action class "edittinMode" type, and
"disable" property and it doesn't work too. So, I must use "request" ? 

--
Milan.


Khawaja-Shahzad Butt wrote:
> 
> 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: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--Set-textfield-readonly-property-from-action-class-tp20738164p20757621.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message