From: Marc P. <ma...@an...> - 2003-08-01 11:05:52
|
Just fiddling a bit more and thought that maybe this would be a nice construct: <input name="somefield" #nulltest $MyProp.SomeProp.FinalProp value="$Value" #end > ...where $Value is a variable created by the directive which refers to the non-null value of the original property evaluation. This reduces repetition and hence errors compared to the very boring: <input name="somefield" #if ($MyProp.SomeProp.FinalProp) value="$MyProp.SomeProp.FinalProp" #end > This #nulltest caters for simple expansion where you just want to render the value if it is not null, but also allows you to do other things with the value while not having to explicitly refer to it. Sure, a #set to a temp var before the #if will also take care of this, but it might be a little bit nicer and doesn't pollute the context. -- Marc Palmer Contract Java Consultant/Developer w a n g j a m m e r s java and web software design experts with an ethical outlook http://www.wangjammers.org |