On Thursday, September 18, 2003, at 11:03 PM, Matt Feifarek wrote:
Randall Randall wrote:It turns out that this works for me. Those extra forms still crept into self._forms, but simply checking to see whether the new submit method was registered for each iteration of creating a form was sufficient to weed it out.
Oh, I see what you mean, now. Since you don't know how many forms you'll have, the name of the submit method isn't necessarily predictable. Yes, I'd stick with one submit method, and just make it a bit more sophisticated about how it does processing. Grabbing "__formID__" from the posted fields, and corresponding that to self._forms should help.
Yeah, I finally opted not to use the Mix-in machinery, although it's mixed into my SitePage, for convenience. Setting a preAction method took care of that, though.
It might be that I'll be able to do it cleanly with the Mix-in, but right now I'm going to leave it as it is: working. :)
I'm still not very clear on the "recommended" way to create forms in awake(), since the way I'm doing it, by manipulating self._forms, doesn't seem very natural. If this is the right way, I can create an example for your Examples folder. If not, and you find the time before the next release, an example of a form created in awake() would be helpful, I think. :)
There's nothing special about awake, really. It's just a method, like any other. The fact that it's called every page load may lead to an explanation about why you're getting extra forms, but it's certainly not designed to work that way.
That having been said, if you come up with a cool example, of course we're interested.
I'll try to see how I can generalize what I did into an example, and send it along.
Thanks!
-- Randall Randall <[EMAIL PROTECTED]> "When you advocate any government action, you must first believe that violence is the best answer to the question at hand." -- Allen Thornton
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss