| Author |
How to get property value for IF?
|
Imre Tokai
Ranch Hand
Joined: Jun 04, 2008
Posts: 123
|
|
Hello, I want to check if one other property of same bean that status belongs to has null value. If it has, radio buttons should be disabled <c:if test=""> <---what should i put here? <html:radio styleId="radio" value="1" property="status"/>Enabled <html:radio styleId="radio" value="0" property="status"/>Disabled </c:if> <c:if test=""> <---what should i put here? <html:radio styleId="radio" value="1" property="status" disabled="true"/>Enabled <html:radio styleId="radio" value="0" property="status" disabled="true"/>Disabled </c:if> Should i work with getProperty? Regards
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56202
|
|
Originally posted by Imre Tokai: Should i work with getProperty?
No, but you haven't given us enough info to help you further either. The basic way to test for equality would be something along the line of: assuming that bean is in scope. You might also want to explore the ternary operator of the EL to help shorten your code. You've got a lot of needless repetition in the code you posted.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Imre Tokai
Ranch Hand
Joined: Jun 04, 2008
Posts: 123
|
|
Thanks for your answer! When i want to display the value of property, i can do it simply in the text label: <td valign="top"><html:text property="status" styleId="textfield6" /></td> everything is OK, but i don't know how to use the value for the IF? <c:if test=""> <---what should i put here? Regards
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56202
|
|
Did you see my example? I'm going to move this to the Struts forum because you seem to be relying upon Struts tags.
|
 |
Imre Tokai
Ranch Hand
Joined: Jun 04, 2008
Posts: 123
|
|
This is the header of my form I'm passing UserManagementForm to the .jsp page I tried with: but then Exception is raised. I also tried with: but the the IF is always false. I checked the value of status in one text label and it is OK Regards
|
 |
Imre Tokai
Ranch Hand
Joined: Jun 04, 2008
Posts: 123
|
|
Problem solved: The problem was that i didn't pass the UserManagementForm, but the DynaActionForm. If sy knows how to do this directly with DynaActionForm i'd appreciate that answer! Thanks! Regards
|
 |
 |
|
|
subject: How to get property value for IF?
|
|
|