You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michelle Popovits <mp...@silverstream.com> on 2001/06/19 16:17:15 UTC

dynamically disable text field

Hi,

I would like to dynamically disable a text field based on a boolean property.
I have tried the following but it does not work.

<strutshtml:text property="employeeBean.fax" size="20" maxlength="10" disabled="<strutsbean:write name=\"personalInfoForm\" property=\"employeeBean.empInfoReadOnly\" scope=\"session\"/>"/>


Any idea how to make this work?

Thanks,
Michelle



RE: Help, How to check (initially) a radio button?

Posted by Kwang-Shi Shu <ks...@vill.com>.
Terps,

	You're right. I made the mistale just as you said. Now it works
fine. Thank you for your help.

Shu, Kwang-shi          | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724    | email: kshu@vill.com


-----Original Message-----
From: Torsten Terp [mailto:torsten@terps.dk]
Sent: Tuesday, June 19, 2001 5:32 PM
To: Kwang-Shi Shu; struts-user@jakarta.apache.org
Subject: RE: Help, How to check (initially) a radio button?


Hi,

I read your post as if you are using a property in the form
with the name of the value element in the radiobutton tag, and
that you tried setting this to "true"?!?! That is not the way to
do it. Have i misunderstood your first post??

You should use the same name in the property element of the buttons
in your group, and initialise the corresponding form variable with
name of the value element for the chosen radiobutton!
It is working for me...

^terp


> -----Original Message-----
> From: Kwang-Shi Shu [mailto:kshu@vill.com]
> Sent: Tuesday, June 19, 2001 11:12 PM
> To: struts-user@jakarta.apache.org; torsten@terps.dk
> Subject: RE: Help, How to check (initially) a radio button?
>
>
> Terp,
>
> 	Thank you for the reply. However, I did exactly as you suggested
> and it did not work. That's why I posted for help.
>
> Shu, Kwang-shi          | Tel 732-460-7848
> Village Networks, Inc.  | Fax 732-460-9851
> 246 Industrial Way West |
> Eatontown, NJ 078724    | email: kshu@vill.com
>
>
> -----Original Message-----
> From: Torsten Terp [mailto:torsten@terps.dk]
> Sent: Tuesday, June 19, 2001 4:49 PM
> To: struts-user@jakarta.apache.org
> Subject: RE: Help, How to check (initially) a radio button?
>
>
> Hi,
>
> If your goal is to have a group of radiobuttons, with one of
> them initially checked, you just use the same property, i.e.,
> "searchCondition" and initialise it to the value of the 'value tag'
> i.e., "strict" :
>
> <html:radio property="searchCondition" value="fuzzy" />
> <html:radio property="searchCondition" value="strict"/>
> <html:radio property="searchCondition" value="whatever" />
>
> ^terp
>
> > -----Original Message-----
> > From: Kwang-Shi Shu [mailto:kshu@vill.com]
> > Sent: Tuesday, June 19, 2001 10:31 PM
> > To: struts-user@jakarta.apache.org; Michelle Popovits; Norman Timmler
> > Subject: Help, How to check (initially) a radio button?
> >
> >
> > Hi,
> >
> > 	I used Struts ActionForm. Within a form, I have several radio buttons
and
> I
> > want to check one of them at the start of the page. Even though I set
the
> > particular radio button value in "actionForm.class" as "true", it did
not
> > work. I tried to put "checked" (just like HTML format) inside the
> > "<html:radio ... >", it did not work since it is not allowed.
> >
> > 	Could somebody show me how to do this? Thanks.
> >
> > Shu, Kwang-shi          | Tel 732-460-7848
> > Village Networks, Inc.  | Fax 732-460-9851
> > 246 Industrial Way West |
> > Eatontown, NJ 078724    | email: kshu@vill.com
> >
> >
> >
>


RE: Help, How to check (initially) a radio button?

Posted by Torsten Terp <to...@terps.dk>.
Hi,

I read your post as if you are using a property in the form 
with the name of the value element in the radiobutton tag, and
that you tried setting this to "true"?!?! That is not the way to 
do it. Have i misunderstood your first post??

You should use the same name in the property element of the buttons
in your group, and initialise the corresponding form variable with
name of the value element for the chosen radiobutton!
It is working for me...

^terp


> -----Original Message-----
> From: Kwang-Shi Shu [mailto:kshu@vill.com]
> Sent: Tuesday, June 19, 2001 11:12 PM
> To: struts-user@jakarta.apache.org; torsten@terps.dk
> Subject: RE: Help, How to check (initially) a radio button?
> 
> 
> Terp,
> 
> 	Thank you for the reply. However, I did exactly as you suggested
> and it did not work. That's why I posted for help.
> 
> Shu, Kwang-shi          | Tel 732-460-7848
> Village Networks, Inc.  | Fax 732-460-9851
> 246 Industrial Way West |
> Eatontown, NJ 078724    | email: kshu@vill.com
> 
> 
> -----Original Message-----
> From: Torsten Terp [mailto:torsten@terps.dk]
> Sent: Tuesday, June 19, 2001 4:49 PM
> To: struts-user@jakarta.apache.org
> Subject: RE: Help, How to check (initially) a radio button?
> 
> 
> Hi,
> 
> If your goal is to have a group of radiobuttons, with one of
> them initially checked, you just use the same property, i.e.,
> "searchCondition" and initialise it to the value of the 'value tag'
> i.e., "strict" :
> 
> <html:radio property="searchCondition" value="fuzzy" />
> <html:radio property="searchCondition" value="strict"/>
> <html:radio property="searchCondition" value="whatever" />
> 
> ^terp
> 
> > -----Original Message-----
> > From: Kwang-Shi Shu [mailto:kshu@vill.com]
> > Sent: Tuesday, June 19, 2001 10:31 PM
> > To: struts-user@jakarta.apache.org; Michelle Popovits; Norman Timmler
> > Subject: Help, How to check (initially) a radio button?
> >
> >
> > Hi,
> >
> > 	I used Struts ActionForm. Within a form, I have several radio buttons and
> I
> > want to check one of them at the start of the page. Even though I set the
> > particular radio button value in "actionForm.class" as "true", it did not
> > work. I tried to put "checked" (just like HTML format) inside the
> > "<html:radio ... >", it did not work since it is not allowed.
> >
> > 	Could somebody show me how to do this? Thanks.
> >
> > Shu, Kwang-shi          | Tel 732-460-7848
> > Village Networks, Inc.  | Fax 732-460-9851
> > 246 Industrial Way West |
> > Eatontown, NJ 078724    | email: kshu@vill.com
> >
> >
> >
> 


RE: Help, How to check (initially) a radio button?

Posted by Kwang-Shi Shu <ks...@vill.com>.
Terp,

	Thank you for the reply. However, I did exactly as you suggested
and it did not work. That's why I posted for help.

Shu, Kwang-shi          | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724    | email: kshu@vill.com


-----Original Message-----
From: Torsten Terp [mailto:torsten@terps.dk]
Sent: Tuesday, June 19, 2001 4:49 PM
To: struts-user@jakarta.apache.org
Subject: RE: Help, How to check (initially) a radio button?


Hi,

If your goal is to have a group of radiobuttons, with one of
them initially checked, you just use the same property, i.e.,
"searchCondition" and initialise it to the value of the 'value tag'
i.e., "strict" :

<html:radio property="searchCondition" value="fuzzy" />
<html:radio property="searchCondition" value="strict"/>
<html:radio property="searchCondition" value="whatever" />

^terp

> -----Original Message-----
> From: Kwang-Shi Shu [mailto:kshu@vill.com]
> Sent: Tuesday, June 19, 2001 10:31 PM
> To: struts-user@jakarta.apache.org; Michelle Popovits; Norman Timmler
> Subject: Help, How to check (initially) a radio button?
>
>
> Hi,
>
> 	I used Struts ActionForm. Within a form, I have several radio buttons and
I
> want to check one of them at the start of the page. Even though I set the
> particular radio button value in "actionForm.class" as "true", it did not
> work. I tried to put "checked" (just like HTML format) inside the
> "<html:radio ... >", it did not work since it is not allowed.
>
> 	Could somebody show me how to do this? Thanks.
>
> Shu, Kwang-shi          | Tel 732-460-7848
> Village Networks, Inc.  | Fax 732-460-9851
> 246 Industrial Way West |
> Eatontown, NJ 078724    | email: kshu@vill.com
>
>
>


RE: Help, How to check (initially) a radio button?

Posted by Torsten Terp <to...@terps.dk>.
Hi,

If your goal is to have a group of radiobuttons, with one of
them initially checked, you just use the same property, i.e., 
"searchCondition" and initialise it to the value of the 'value tag'
i.e., "strict" :

<html:radio property="searchCondition" value="fuzzy" />
<html:radio property="searchCondition" value="strict"/>
<html:radio property="searchCondition" value="whatever" />

^terp

> -----Original Message-----
> From: Kwang-Shi Shu [mailto:kshu@vill.com]
> Sent: Tuesday, June 19, 2001 10:31 PM
> To: struts-user@jakarta.apache.org; Michelle Popovits; Norman Timmler
> Subject: Help, How to check (initially) a radio button?
> 
> 
> Hi,
> 
> 	I used Struts ActionForm. Within a form, I have several radio buttons and I
> want to check one of them at the start of the page. Even though I set the
> particular radio button value in "actionForm.class" as "true", it did not
> work. I tried to put "checked" (just like HTML format) inside the
> "<html:radio ... >", it did not work since it is not allowed.
> 
> 	Could somebody show me how to do this? Thanks.
> 
> Shu, Kwang-shi          | Tel 732-460-7848
> Village Networks, Inc.  | Fax 732-460-9851
> 246 Industrial Way West |
> Eatontown, NJ 078724    | email: kshu@vill.com
> 
> 
> 


Re: Help, How to check (initially) a radio button?

Posted by Eda Srinivasareddy <ed...@yahoo.com>.
  


---------------------------------
Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo! Mail.

Help, How to check (initially) a radio button?

Posted by Kwang-Shi Shu <ks...@vill.com>.
Hi,

	I used Struts ActionForm. Within a form, I have several radio buttons and I
want to check one of them at the start of the page. Even though I set the
particular radio button value in "actionForm.class" as "true", it did not
work. I tried to put "checked" (just like HTML format) inside the
"<html:radio ... >", it did not work since it is not allowed.

	Could somebody show me how to do this? Thanks.

Shu, Kwang-shi          | Tel 732-460-7848
Village Networks, Inc.  | Fax 732-460-9851
246 Industrial Way West |
Eatontown, NJ 078724    | email: kshu@vill.com


Re: dynamically disable text field

Posted by Michelle Popovits <mp...@silverstream.com>.
Norman,
Yes, that worked.

Thanks,
Michelle
----- Original Message -----
From: "Norman Timmler" <no...@net-eye.de>
To: <st...@jakarta.apache.org>; "Michelle Popovits"
<mp...@silverstream.com>
Sent: Tuesday, June 19, 2001 11:10 AM
Subject: Re: dynamically disable text field


> hi michelle,
>
> try this:
>
> <logic:equal name=\"personalInfoForm\"
> property=\"employeeBean.empInfoReadOnly\" scope=\"session\" value="true">
>     <html:text property="employeeBean.fax" size="20" maxlength="10"
> disabled="true"/>
> </logic:equal>
> <logic:notEqual name=\"personalInfoForm\"
> property=\"employeeBean.empInfoReadOnly\" scope=\"session\" value="true">
>     <html:text property="employeeBean.fax" size="20" maxlength="10"
> disabled="false"/>
> </logic:notEqual>
>
> hope this helps.
> norman
>
>
> ----- Original Message -----
> From: "Michelle Popovits" <mp...@silverstream.com>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, June 19, 2001 4:17 PM
> Subject: dynamically disable text field
>
>
> Hi,
>
> I would like to dynamically disable a text field based on a boolean
> property.
> I have tried the following but it does not work.
>
> <strutshtml:text property="employeeBean.fax" size="20" maxlength="10"
> disabled="<strutsbean:write name=\"personalInfoForm\"
> property=\"employeeBean.empInfoReadOnly\" scope=\"session\"/>"/>
>
>
> Any idea how to make this work?
>
> Thanks,
> Michelle
>
>
>


Re: dynamically disable text field

Posted by Norman Timmler <no...@net-eye.de>.
hi michelle,

try this:

<logic:equal name=\"personalInfoForm\"
property=\"employeeBean.empInfoReadOnly\" scope=\"session\" value="true">
    <html:text property="employeeBean.fax" size="20" maxlength="10"
disabled="true"/>
</logic:equal>
<logic:notEqual name=\"personalInfoForm\"
property=\"employeeBean.empInfoReadOnly\" scope=\"session\" value="true">
    <html:text property="employeeBean.fax" size="20" maxlength="10"
disabled="false"/>
</logic:notEqual>

hope this helps.
norman


----- Original Message -----
From: "Michelle Popovits" <mp...@silverstream.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 4:17 PM
Subject: dynamically disable text field


Hi,

I would like to dynamically disable a text field based on a boolean
property.
I have tried the following but it does not work.

<strutshtml:text property="employeeBean.fax" size="20" maxlength="10"
disabled="<strutsbean:write name=\"personalInfoForm\"
property=\"employeeBean.empInfoReadOnly\" scope=\"session\"/>"/>


Any idea how to make this work?

Thanks,
Michelle