Results 1 to 2 of 2
Thread: Problem with <s:if> and string
- 08-23-2012, 09:37 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 9
- Rep Power
- 0
Problem with <s:if> and string
Hi
I have code
isActive is equal to 'Y' (checked in generated page), but button has value "INACTIVE". How should I compare variable with string? Google says that my way is correct, but it still doesn't work...Java Code:<s:form action="SwitchActive" method="POST"> <s:hidden name="isActive" value="%{isActive}" /> <s:if test="%{#isActive=='Y'}"> <s:submit value="ACTIVE" name="switchActiveButton" /> </s:if> <s:else> <s:submit value="INACTIVE" name="switchActiveButton" /> </s:else> </s:form>
- 08-24-2012, 09:44 PM #2
Member
- Join Date
- Jan 2012
- Posts
- 9
- Rep Power
- 0
Re: Problem with <s:if> and string
ok, found workaround (or just working way?)
Java Code:<s:set name="isActiveVar" value="%{isActive}" /> <s:form action="SwitchActive" method="POST"> <s:hidden name="isActive" value="%{isActive}" /> <s:if test="%{#isActiveVar==\"Y\"}"> <s:submit value="ACTIVE" name="switchActiveButton" /> </s:if> <s:else> <s:submit value="INACTIVE" name="switchActiveButton" /> </s:else> </s:form>
Similar Threads
-
Having a problem with to String
By thorobred in forum New To JavaReplies: 20Last Post: 06-02-2012, 08:24 AM -
Problem splitting a string
By sehudson in forum New To JavaReplies: 2Last Post: 03-13-2011, 08:56 PM -
SIMPLE String problem
By vince_enzwo in forum New To JavaReplies: 15Last Post: 02-13-2011, 04:06 PM -
Basic string problem, just need to extract two numbers out of string
By gonzoateafly in forum New To JavaReplies: 6Last Post: 12-06-2010, 09:26 AM -
String Problem
By gnomewise in forum New To JavaReplies: 1Last Post: 10-19-2008, 12:37 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks