struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <anant.parn...@wipro.com>
Subject RE: Making the fields non editable dynamically using a form bean element
Date Mon, 02 Feb 2004 13:12:22 GMT

Thanks a ton
It worked for me :-)

Regards

Anant

-----Original Message-----
From: Claire Wall [mailto:claire.wall@kurtosys.com]
Sent: Monday, February 02, 2004 6:09 PM
To: Struts Users Mailing List
Subject: Re: Making the fields non editable dynamically using a form
bean element


Anant,

You can do the following:

set up a boolean flag at the top of the jsp page that will be used to
disable fields on your page like so:

<% boolean flag = false; %>

and then set this according to the value of the flag in your form using
logic tags:

<logic:equal name="FormName" property="xxx" value="true">
    <% flag = true; %>
</logic:equal>

<logic:equal name="FormName" property="xxx" value="false">
    <% flag = false; %>
</logic:equal>

and then in your <html:text> elements do this:

<html:text property="xxx" disabled="<%= flag %>"/>


you have to make sure though that the boolean is set to the right value
(so that if you wish to disable something it is true - this got me
caught out a few times!)


HTH
Claire :)


----- Original Message -----
From: <anant.parnami@wipro.com>
To: <struts-user@jakarta.apache.org>
Sent: Monday, February 02, 2004 10:35 AM
Subject: Making the fields non editable dynamically using a form bean
element




Hi ppl,


I have a situation where I do not want the user to edit the fields if
the history record flag in the form bean is true. Can you suggest me how
to go about it. Can I use a form bean element
(java.lang.Boolean/String) to disable a <html:text> dynamically
depending on its value.


If yes then how can I do it?

Thanks a ton in advance

Regards

Anant Parnami



Confidentiality Notice

The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s)
and may contain confidential or privileged information. If you are not
the intended recipient, please notify the sender at Wipro or
Mailadmin@wipro.com immediately and destroy all copies of this message
and any attachments.

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






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


Confidentiality Notice

The information contained in this electronic message and any attachments to this message are
intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information.
If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com
immediately
and destroy all copies of this message and any attachments.

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


Mime
View raw message