yes that works! so obviously, webwork binds the METHODS to
the velocity variable names and not the method RESULT
some how ?
any
way, thank you for the tip. good to know that, this behavior is prone for
performance-troubles... ;-)
hans
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Jason Carreira
Gesendet: Freitag, 20. Februar 2004 16:41
An: [EMAIL PROTECTED]
Betreff: RE: Spam:[OS-webwork] WW2 Actions Velocity Result - getters called multiple?You could bind it into a different name above the for loop and use that other name... this should make it only call the getter once.-----Original Message-----
From: Hans Prueller [mailto:[EMAIL PROTECTED]
Sent: Friday, February 20, 2004 10:13 AM
To: [EMAIL PROTECTED]
Subject: Spam:[OS-webwork] WW2 Actions Velocity Result - getters called multiple?is is the normal case that an Actions getXXX() method is called every time a velocity-result template uses the $XXX variable?if my action has a method, say HashMap getLabelsForType() and it is used in velocity result like#foreach ($type in $types)<td> $labelsForType.get($type) </td>#endthe method getLabelsForType is called for every iteration of the foreach loop. I tought the returned HashMap of getLabelsForType() isput into the velocity context before rendering and thats it...is that my mistake or is there a deeper sense???thanx in advance,Hans