struts tag inside a tag

K

kishan bisht

Hi,

Can I specify a disabled attribute of a text tag using another tag.

For example:
<html:text property="name" size="40" maxlength="40" <logic:equal
name="form" property="textDisabled" value="yes">disabled</logic:equal>
/>

Here I have to disable the text depending upon the property
"textDisabaled". The above thing is not working.

Has anyone tried this thing before. I am using struts 1.02.

cheers

Kishan
 
W

Wendy S

kishan bisht said:
Can I specify a disabled attribute of a text tag using another tag.

No tags inside of tags, if you really need this, consider Struts-EL and
JSTL. (You know Struts 1.1 final is out now, right?)
<html:text property="name" size="40" maxlength="40" <logic:equal
name="form" property="textDisabled" value="yes">disabled</logic:equal>
/>

Pull the logic:equal outside:

<logic:equal name="form" property="textDisabled" value="yes">
<html:text property="name" size="40" maxlength="40" disabled="true" />
</logic:equal>

<logic:notEqual name="form" property="textDisabled" value="yes">
<html:text property="name" size="40" maxlength="40" />
</logic:equal>

Only one of those will be rendered. (Blech. Struts-EL and JSTL is a better
way to do this, is there some reason you're stuck on Struts 1.0?)

I can't find the docs for 1.0, but I'm wondering if maybe 'disabled' was not
supported then?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top