Issue Details (XML | Word | Printable)

Key: WW-651
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Patrick Lightbody
Reporter: John Patterson
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
WebWork

IfTag does not convert to Boolean

Created: 01/Oct/04 06:16 AM   Updated: 23/Oct/04 04:55 PM
Component/s: None
Affects Version/s: 2.1.2
Fix Version/s: 2.1.5


 Description  « Hide
The IfTag calls findValue(test) and if the return value is a Boolean it uses that to determine if the body should be rendered.

This does not allow usage such as this:

<ww:if test="business.location"> ... </ww:if>

The ognl TypeConverter can coerce any object to a Boolean which would make the WW2 IfTag much more flexible. It would then work with Strings that equal "true", numbers that are non zero etc.

It could be changed to ask for a Boolean like so:

 findValue(test, Boolean.class)

I have made this change and it seems to work well so far!

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Patrick Lightbody added a comment - 19/Oct/04 11:07 AM
I think this was fixed in 2.1.4, but I will verify.