Re: Bunch of issues...
Jason Carreira <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <26848028.1145308897057.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
Ok, well if you want to do it the HARD way :-) I'd suggest looking at the type conversion docs and have an ActionClassName-conversion.properties that tells what type is supposed to be in the collection. This might help it know whether it needs to do type conversion. I'm guessing what's happening is that it's trying to call that getTotals() method and it doesn't know what the items in the list it expects are, so it's converting them to Strings (which is the default type), but I could be wrong because I haven't looked at the collection type conversion in detail since it was overhauled for 2.2. I'm still not sure this will work, since I don't think type conversion hints are handled for incoming parameter types, just for the property types in getters and setters. Overall I'd say you're getting too fancy in your page, and putting too much script there. If it's expensive to calculate the records, then cache them in your action. Rather than passing the records to the page and back to the action, have a getRecordTotals() which uses the records to calculate the totals. > Jason, cut and paste error, the method does take a > parameter (it's not relevant anyway if it does or > doesn't). > > I know I COULD get it working by sidestepping the > issue and just calling getReports again. I also know > that since it's an expensive call, I can just look it > up once and make it a field in my action. Sure, there > are workarounds, but that's completely missing the > point. I'd like to know WHY this doesn't work (forget > erasure, it's not relevant in this case), and why I > can't write my action without the extra junk, and > just have my page take care of only calling > getReports(...) once, then passing the result of that > around. --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=26282&messageID=51722#51722 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]