You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(7) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Luke O. <lu...@me...> - 2003-05-09 22:57:58
|
> As I'm rethinking FFK (i.e., FormEncode), I've left out this hook > (which wasn't in FFK originally either). So maybe I'll bring it up > -- what should this really do? Yes, I need to take a closer look at FormEncode, get more of a feel of what's changing... > If it's for CSS classes and Javascript, then I think those hooks > should be added directly (i.e., a class_ attribute, and onClick, > etc., attributes). But maybe it's not practical to make that > complete (OTOH, at some point you're going to have to create your > own widget). I started doing this as I was trying to find an alternative to extraHTML this morning. The problem was that we immediately identified that there are a LOT of javascript eventhandler attrs, and I didn't feel like typing that much into every field. :) And knew I wouldn't be complete. In general I tend to create new Field subclasses for most of these needs, as opposed to external onChange js functions etc. But sometimes it's easier, and I think it will always be relevant to want to pass some arbitrary attributes that we can't predict now. Also, if there's no arbitrary way to add attrs, making your own widget is harder as well (if I make a SuperSelectField that does something requiring javascript, but I can't reuse SelectField's htInput method because I want to add a specialized attr, I end up duplicating that code, and making my life harder). We played around with a more constrained version of extraHTML, extraAttrs = {'onChange': 'randomFunction()', 'class': 'myStyle'} , with the advantage that a field could easily check this for conflicts with attrs that it needs, and it fit more neatly into the HTMLGen idea. But other developers here found the syntax a little too abstract when compared to the benefits. I guess in general I don't want to promote the use of extraHTML, but in enough cases we've found it to be useful "used at your own risk" to implement a one-time workaround/addition for a basic fieldtype. As a second choice, I'd take an extraAttrs option. > The problem with extraHTML is also that it's not always clear where > it goes -- compound widgets don't have a clear location. Completely agree. I left it off of these (like DateField, TextareaFileUpload, etc), precisely because it's not clear. And extraAttrs doesn't solve this. I'm undecided on whether these specialized widgets affect my feelings about extraHTML, though. Hmm. - Luke |
From: Ian B. <ia...@co...> - 2003-05-09 21:22:38
|
On Fri, 2003-05-09 at 14:22, Luke Opperman wrote: > If anyone's interested, I've made modifications to FFK to support the > extraHTML argument from FFK 0.3, for adding attributes within an HTML > tag (we use it for javascript events and CSS classes primarily, for > instance). As I'm rethinking FFK (i.e., FormEncode), I've left out this hook (which wasn't in FFK originally either). So maybe I'll bring it up -- what should this really do? If it's for CSS classes and Javascript, then I think those hooks should be added directly (i.e., a class_ attribute, and onClick, etc., attributes). But maybe it's not practical to make that complete (OTOH, at some point you're going to have to create your own widget). The problem with extraHTML is also that it's not always clear where it goes -- compound widgets don't have a clear location. Ian |
From: Luke O. <lu...@me...> - 2003-05-09 19:36:52
|
If anyone's interested, I've made modifications to FFK to support the extraHTML argument from FFK 0.3, for adding attributes within an HTML tag (we use it for javascript events and CSS classes primarily, for instance). This was done with a change to SimpleHTMLGen.Tag to support 'extraHTML' as a special argument (full python below), and then adding 'extraHTML=self._extraHTMLCode(options)' to the html.input( ) blocks if appropriate. (_extraHTMLCode utility method was already written by Ian, but not used anywhere, due to the mismatch between arbitrary attribs and the HTMLGen system, I assume.) I'm not sure I'm entirely happy with the result, it removes some of the cleanliness of the HTMLGen process, and users can screw themselves by putting already-used attrs in extraHTML, but that's how it's always been. :) Enjoy, - Luke ------ SimpleHTMLGen.py: def Tag(tag, *args, **kw): if kw.has_key("c"): assert not args, "The special 'c' keyword argument cannot be used in conjunction with non-keyword arguments" args = kw["c"] del kw["c"] if type(args) not in (type(()), type([])): args = (args,) extraHTML = '' if kw.has_key("extraHTML"): extraHTML = " %s" % kw["extraHTML"] del kw["extraHTML"] htmlArgs = [' %s="%s"' % (attrEncode(attr), htmlEncode(value)) for attr, value in kw.items() if value is not Exclude] if not args and emptyTags.has_key(tag): if blockTags.has_key(tag): return "<%s%s%s/>\n" % (tag, "".join(htmlArgs),extraHTML) else: return "<%s%s%s/>" % (tag, "".join(htmlArgs),extraHTML) else: if blockTags.has_key(tag): return "<%s%s%s>\n%s\n</%s>\n" % ( tag, "".join(htmlArgs), extraHTML, "".join(map(str, args)), tag) else: return "<%s%s%s>%s</%s>" % ( tag, "".join(htmlArgs), extraHTML, "".join(map(str, args)), tag) |
From: Luke O. <lu...@me...> - 2003-04-10 14:58:09
|
Quoting Edmund Lian <el...@in...>: > > On 04/09/2003 10:11:06 AM funformkit-discuss-admin wrote: > > >Not sure if this is in CVS? Just a "+" instead of "%". > > > >- Luke > > > >class RadioField(SelectField): > > > > def htInputRender(....): > > ... > > out.write(html.label( > >>> for_='%s_%i' + (nameMap(self.name()), > id), > ><< for_='%s_%i' % (nameMap(self.name()), > id), > > c=htmlEncode(value))) > > out.write(html.br()) > > What's the effect of having a "+" there? I've not noticed > any problems, and > looking at the code, it looks like a % is correct since > there is a string > substitution going on. > > ...Edmund. Um, I guess my email was ambiguous. There IS a + there, and it SHOULD be a %. Just checked CVS, it's a + there as well. To sum up, the fix is to change it to a %, because (like you say) there is string substitution going on. The error you'll get is "cannot add string to tuple" with the current code. - Luke |
From: Ian B. <ia...@co...> - 2003-04-10 00:40:03
|
On Wed, 2003-04-09 at 19:21, Luke Opperman wrote: > Hey all - > > We weren't able to figure out how to set the defaults for a > repeating field, from the existing code it would only take > a single common default. Really? The AddressList example has repeating defaults -- you just pass in a list for default value. Maybe that's broken if it's not a top-level repeat or something... > #this might be considered list-comp abuse. > defaultValues = \ > [defaultValue for x in range(options['repeat']) ] Especially because you could just do defaultValue = range(options['repeat']) :) |
From: Luke O. <lu...@me...> - 2003-04-10 00:39:22
|
Damn, one little typo... here's the corrected version, that works with original AND new functionality. :) - Luke def html(): ... if options.get('repeat') and options['repeat'] > 1: assert self._repeatable, "You must indicate a field is repeatable when it is defined" out = [html.input(type="hidden", name=suffixMap(".repetitions",nameMap)(self.name()), value=options['repeat'])] if type(defaultValue) is not ListType: # build list of defaults... # this might be considered list-comp abuse. defaultValues = \ [defaultValue for x in range(options['repeat'])] else: assert len(defaultValue) == options['repeat'] defaultValues = defaultValue for i in range(options['repeat']): nm = suffixMap(".%i" % i, nameMap) out.append(self.htWidget(defaultValues[i], options, nameMap=nm)) return out -- Many people are hamstrung by things like affection for fellow employees, honesty, desire to appear to be a "nice person," and other crippling limitations not suffered by the truly powerful and successful. |
From: Luke O. <lu...@me...> - 2003-04-10 00:34:49
|
Hey all - We weren't able to figure out how to set the defaults for a repeating field, from the existing code it would only take a single common default. Here's patched code to Field.py (around line 212, html()) to allow optionally passing a list of default values for each repeated field. Defaults for the field either can be old-style single value, or a list that must have the same number of elements as repetitions. Enjoy, - Luke def html(): ... if options.get('repeat') and options['repeat'] > 1: assert self._repeatable, "You must indicate a field is repeatable when it is defined" out = [html.input(type="hidden", name=suffixMap(".repetitions",nameMap)(self.name()), value=options['repeat'])] if type(defaultValue) is not ListType: # build list of defaults... #this might be considered list-comp abuse. defaultValues = \ [defaultValue for x in range(options['repeat']) ] else: assert len(defaultValue) == options['repeat'] defaultValues = defaultValue for i in range(options['repeat']): nm = suffixMap(".%i" % i, nameMap) out.append(self.htWidget(defaultValue[i], options, nameMap=nm)) return out |
From: Ian B. <ia...@co...> - 2003-04-09 19:07:19
|
On Wed, 2003-04-09 at 09:20, Aaron Held wrote: > Ian, > > One of my upcomming projects at work involve a web based "access" app > as well. > Actually more of a Quickbase clone (http://www.quickbase.com) > > Its on my roadmap for a basic implementation to go into testing in > about 2-3 months. > > Where is any FunFormKit-NG stuff? Like I said, it's mostly a glimmer in my eye. It involves a significant change in design, putting the concept of a schema at the center, where the other parts of the form definition (TextField, etc) are a view on that schema. Something like SQLObject would be attached, in that it would be possible to annotate the columns with validation and potentially view information. The validation wouldn't be solely form-oriented, but would be applied to all interfaces to the object. I put some of the code I've been playing with into the Sandbox, under FormEncode. Another hope I have is that the new design will be more testable. Ian |
From: Edmund L. <el...@in...> - 2003-04-09 18:41:37
|
On 04/09/2003 10:11:06 AM funformkit-discuss-admin wrote: >Not sure if this is in CVS? Just a "+" instead of "%". > >- Luke > >class RadioField(SelectField): > > def htInputRender(....): > ... > out.write(html.label( >>> for_='%s_%i' + (nameMap(self.name()), id), ><< for_='%s_%i' % (nameMap(self.name()), id), > c=htmlEncode(value))) > out.write(html.br()) What's the effect of having a "+" there? I've not noticed any problems, and looking at the code, it looks like a % is correct since there is a string substitution going on. ...Edmund. |
From: Luke O. <lu...@me...> - 2003-04-09 14:24:20
|
Not sure if this is in CVS? Just a "+" instead of "%". - Luke class RadioField(SelectField): def htInputRender(....): ... out.write(html.label( >> for_='%s_%i' + (nameMap(self.name()), id), << for_='%s_%i' % (nameMap(self.name()), id), c=htmlEncode(value))) out.write(html.br()) -- Many people are hamstrung by things like affection for fellow employees, honesty, desire to appear to be a "nice person," and other crippling limitations not suffered by the truly powerful and successful. |
From: Luke O. <lu...@me...> - 2003-03-31 22:54:31
|
Field.SubmitButton.htInput: query = ' onClick="return window.confirm(\'%s\')"' % htmlEncode(javascriptQuote(self._confirm)) Fixed version: query = ' return window.confirm(\'%s\')' % htmlEncode(javascriptQuote(self._confirm)) Because html.input is taking a kwarg called "onClick=query", onClick= is printed twice in the current version. (Ian: Would you like bug reports submitted using the Sourceforge tracker? or how?) - Luke |
From: Edmund L. <el...@in...> - 2003-03-30 19:17:43
|
Sorry about the bad subject line regarding Max Ischenko's SubmitButton patch. Forgot to change it. Anyway, I've also checked in patchs to SimpleHTMLGen and Field.py to support the static option in MultiCheckboxField and CheckboxField, as well as boolean results in the latter. Tested with Mozilla 1.3 and IE 5.5. Corrections welcome--in particular, the code really ought to be refactored to separate the notion of static fields from hidden fields. They are being treated as synonymous by Field.htWidget(), when in fact, they can be distinct as shown by the need to override htWidget in MultiCheckboxField and CheckboxField. ...Edmund. |
From: Edmund L. <el...@in...> - 2003-03-30 19:11:21
|
On 03/26/2003 01:24:09 AM Max wrote: >PS: Btw, you still doesn't integrate my patch to SubmitButton which >fixes incorrect display of labels like "Next >". > >--- Field.py Tue Feb 11 09:52:08 2003 >+++ /tmp/Field.py Wed Mar 26 08:17:12 2003 >@@ -613,6 +613,9 @@ > > def valueFromFields(self, fields, nameMap=identity): > return fields.has_key(nameMap(self.name())) >+ >+ def description(self): >+ return self._description > > def isSubmit(self, options={}): > return True Committed. ...Edmund. |
From: Ian B. <ia...@co...> - 2003-03-30 17:28:47
|
On Sat, 2003-03-29 at 17:38, Luke Opperman wrote: > First, a tiny bug: Field.py line, ImageSubmit class, htInput > method: the html.input attrs has "src" misspelled as "srg". > I'd also like ImageSubmit to take an option "imgSrc" to > override the initial imgSrc. Okay, done in CVS. > Second, completely unrelated: the recurring problem of > rendering two separate forms on the same page at the same > time. We believe we have a solution! :) It hasn't been working for you? As long as you give both the forms different names, it should work okay. Well, there may be bugs, but I don't think any more interface should be required. Each form puts a _formID_ hidden variable in the form, so only one _formID_ should show up on a submit, which is what processForm looks for. So it will only ever process a single form... if more than one _formID_ shows up it should just barf, so there won't be double submits. What's the problem you're having with this? Ian |
From: Edmund L. <el...@in...> - 2003-03-30 06:23:01
|
On 03/30/2003 01:11:28 AM Ian Bicking wrote: >Cool. Will the static versions work in older browsers (i.e., NS4)? I don't know--I don't have NS4 to check. It does work with Mozilla 1.3 and IE 5 though. I think it should work in NS4 because I'm not doing anything special. Disabled checkboxes are checkbox input fields with "disabled" tags in them. But because these are not returned on a form submit, each disabled checkbox that has been selected is accompanied by a hidden text input field containing the value of the checkbox. BTW, I had to hack a little to get the things to work--the htWidget method in the Field base class makes too many assumptions about how static fields should be generated. Likewise, there needs to be some notional separation between hidden and static fields. They can be very different, but htWidget assumes that they are synonymous. ...Edmund. |
From: Ian B. <ia...@co...> - 2003-03-30 06:10:39
|
On Sat, 2003-03-29 at 21:38, Edmund Lian wrote: > I've hacked MultiCheckboxField and CheckboxField to properly support the > static and hide options. Static multi and single checkbox fields actually > appear as greyed-out checkboxes, etc. I had to modify SimpleHTMLGen a > little to support these changes. The change is that the html function is > now able to generate valueless tags like "disabled". Cool. Will the static versions work in older browsers (i.e., NS4)? > In addition, I've modified CheckboxField to return 1 and 0 (true and false) > rather than "on" and 0, to be consistent with both documentation and > expectations. > > These are relatively largish changes that will break code that depends on > getting "on" and 0 from CheckboxFields, so I'm not sure if I should check > them into CVS. Anyone who is checking for "on" specifically is being silly. What you describe sounds just fine. Go ahead with the checkin... if there's problems, I don't mind sorting them out in CVS. Ian |
From: Luke O. <lu...@me...> - 2003-03-30 05:44:55
|
Yes, we've made similar modifications to get true/false values, so I'd appreciate them in cvs and the next release. :) - Luke Quoting Edmund Lian <el...@in...>: > > Gee, I forgot that this mailing list exists... should have just posted the > following here, rather than the Webware list a few days ago... > > I've hacked MultiCheckboxField and CheckboxField to properly support the > static and hide options. Static multi and single checkbox fields actually > appear as greyed-out checkboxes, etc. I had to modify SimpleHTMLGen a > little to support these changes. The change is that the html function is > now able to generate valueless tags like "disabled". > > In addition, I've modified CheckboxField to return 1 and 0 (true and false) > rather than "on" and 0, to be consistent with both documentation and > expectations. > > These are relatively largish changes that will break code that depends on > getting "on" and 0 from CheckboxFields, so I'm not sure if I should check > them into CVS. > > What's the feeling? > > ...Edmund. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: > The Definitive IT and Networking Event. Be There! > NetWorld+Interop Las Vegas 2003 -- Register today! > http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en > _______________________________________________ > Funformkit-discuss mailing list > Fun...@li... > https://lists.sourceforge.net/lists/listinfo/funformkit-discuss > |
From: Edmund L. <el...@in...> - 2003-03-30 03:38:56
|
Gee, I forgot that this mailing list exists... should have just posted the following here, rather than the Webware list a few days ago... I've hacked MultiCheckboxField and CheckboxField to properly support the static and hide options. Static multi and single checkbox fields actually appear as greyed-out checkboxes, etc. I had to modify SimpleHTMLGen a little to support these changes. The change is that the html function is now able to generate valueless tags like "disabled". In addition, I've modified CheckboxField to return 1 and 0 (true and false) rather than "on" and 0, to be consistent with both documentation and expectations. These are relatively largish changes that will break code that depends on getting "on" and 0 from CheckboxFields, so I'm not sure if I should check them into CVS. What's the feeling? ...Edmund. |
From: Luke O. <lu...@me...> - 2003-03-29 23:51:36
|
Hello all - Putting in some quality Saturday work musings, I've come up with a couple issues for FunFormKit (0.4+) First, a tiny bug: Field.py line, ImageSubmit class, htInput method: the html.input attrs has "src" misspelled as "srg". I'd also like ImageSubmit to take an option "imgSrc" to override the initial imgSrc. (This is required for us when we have a form that is rendered across a site, in varying directories and dir levels.) So here's my revised ImageSubmit.htInput: def htInput(self, default, options, nameMap=identity): return html.input( type="image", name=nameMap(self.name()), value=self.description(), src=self.option('imgSrc', options=options, default=self._imgSrc), height=self._imgHeight, width=self._imgWidth, border=self._border) Second, completely unrelated: the recurring problem of rendering two separate forms on the same page at the same time. We believe we have a solution! :) The setup: two separate formdefs, rendered in different parts of the page, so we have "writeFirstForm(self)" and "writeSecondForm(self)", which each want to call self.processForm and then go on to "renderFirstForm" or "renderSecondForm", or print out a success message. The problem is that processForm should in this case only process the form that's being handled then (we don't want to call it for the same form twice in a page, and end up adding two orders etc). So, we'd like to add an optional named argument to processForm, which will be the name of the form to process if possible. If the submitted form (if any) doesn't match, processForm will return (False, 'noform'), just as it does when there is no form at all submitted. This shouldn't break any existing code, and gives more control to the servlet. Snippet of new processForm: def processForm(self, transaction=None, formName=None): ... if not currentForm: return False, 'noform' if formName and currentForm.name() != formName: return False, 'noform' ... Comments appreciated, - Luke |
From: Tripp L. <tl...@pe...> - 2002-08-30 21:36:27
|
On 30 Aug 2002, Ian Bicking wrote: > On Fri, 2002-08-30 at 15:38, Tripp Lilley wrote: > > Is FFK discussion mostly taking place in webware-discuss? Or is there just > > not much FFK discussion at all? :) I notice that the FFK list is pretty > > dead. > > No, there's not a lot of FFK discussion. Using webware-discuss is > probably best, as more people using FFK will likely read the discussion > or question. And, I suppose, likewise with FFK development questions to webware-devel? (hey, and now this info is in the archives for future Formanauts to find :) ). |
From: Ian B. <ia...@co...> - 2002-08-30 21:34:47
|
On Fri, 2002-08-30 at 15:38, Tripp Lilley wrote: > Is FFK discussion mostly taking place in webware-discuss? Or is there just > not much FFK discussion at all? :) I notice that the FFK list is pretty > dead. No, there's not a lot of FFK discussion. Using webware-discuss is probably best, as more people using FFK will likely read the discussion or question. Ian |
From: Tripp L. <tl...@pe...> - 2002-08-30 20:37:41
|
Is FFK discussion mostly taking place in webware-discuss? Or is there just not much FFK discussion at all? :) I notice that the FFK list is pretty dead. |
From: Erik F. <for...@ly...> - 2002-06-17 20:16:07
|
From: Erik Forsberg <for...@ly...> Subject: [Webware-discuss] FunFormKit and several forms on one page. To: web...@li... Date: 16 Jun 2002 22:36:21 +0200 Hi! (Tried this on the webware-discuss-list. Didn't find this list at first) I'm trying to put several forms on one page, each with it's own submit button. I run into an Exception when using a validator: FormError: Upon error you must render the form that caused the error -- form addistrictform had an error and you tried to render addareaform Here's my servlet: --snip-- from Lib.SecurePage import SecurePage from Cheetah.Template import Template from FunFormKit.Form import FormDefinition, FormServlet from FunFormKit import Field from FunFormKit.Validator import FormValidator, ValidatorConverter, \ InvalidField from Lib.Validators import ServletValidator class DistrictValidator(ServletValidator): def convert(self, districtid): try: num_districtid = int(districtid) except ValueError: raise InvalidField, self.servlet.setting('MustBeNumberMessage') district = self.servlet.getDistrict(num_districtid) if district is None: return num_districtid else: raise InvalidField, \ self.servlet.setting('DistrictNumberTakenMessage') class SystemConfig(SecurePage, FormServlet): def __init__(self): SecurePage.__init__(self) areaForm = FormDefinition('SystemConfig', 'writeForm', [Field.TextField('areaname', maxLength=255, size=25), Field.TextField('lettercode', maxLength=2, size=2), Field.SubmitButton('submit', methodToInvoke='addarea')], name="addareaform") districtForm = FormDefinition('SystemConfig', 'writeForm', [Field.TextField('districtname', maxLength=255, size=25), Field.TextField('shortname', maxLength=255, size=5), Field.TextField('districtid', maxLength=2, size=2, validators=\ [DistrictValidator(self)]), Field.SubmitButton('submit', methodToInvoke=\ 'addistrict')], name="addistrictform") FormServlet.__init__(self, 'writeContent', [areaForm, districtForm], defaultFormDefinition=areaForm) def addarea(self, fieldDict): self.addArea(fieldDict["lettercode"], fieldDict["areaname"]) self.response().sendRedirect("SystemConfig") def addistrict(self, fieldDict): self.addDistrict(fieldDict["districtid"], fieldDict["shortname"], fieldDict["districtname"]) self.response().sendRedirect("SystemConfig") def awake(self, trans): SecurePage.awake(self, trans) if trans.request().hasField("deletearea"): self.deleteArea(int(trans.request().field("deletearea"))) self.response().sendRedirect("SystemConfig") if trans.request().hasField("deletedistrict"): self.deleteDistrict(int(trans.request().field("deletedistrict"))) self.response().sendRedirect("SystemConfig") def title(self): return 'Konfiguration av FUFReg' def defaultConfig(self): secConf = SecurePage.defaultConfig(self) secConf.update({'RequiredLevel':400}) return secConf def writeForm(self): areas = self.getAreas() districts = self.getDistricts() areaRF = self.renderableForm('addareaform') districtRF = self.renderableForm('addistrictform') t = Template(file=self.getTemplateName("SystemConfig"), searchList = [{'areas':areas, 'areaRF':areaRF, 'districts':districts, 'districtRF':districtRF}]) self.write(str(t)) --snap-- (The ServletValidator class looks like this: class ServletValidator(ValidatorConverter): def __init__(self, servlet): ValidatorConverter.__init__(self) self.servlet = servlet SecurePage inherits from SitePage that inherits from SidebarPage and MiscUtils.Configurable - If you need more code for debugging, just tell me) The template looks like this: --snip-- ## mode: html <H1>Landsting och deras kommuner</H1> Klicka på Landstinget namn för att se och editera dess kommuner. <table> <tr> <th align="left">Länsbokstav</th><th align="left">Landsting</th> </tr> #for $row in $areas <tr> <td align="left">${row.lettercode}</td> <td align="left"><a href="SubAreaConfig?area=$row.id">${row.name}</a></td> <td align="left"> #if 0 == $row.noofsubareas and 0 == $row.noofsubsocieties <a href="SystemConfig?deletearea=$row.id">Radera</a> #else <font color="grey">Kan ej raderas</a> #end if </tr> #end for </table> Om ett landsting ej kan raderas beror det på att det finns föreningar eller kommuner som beror på detta landsting. <H3>Lägg till landsting</H3> ${areaRF.start} <TABLE> <tr> <td align="right" valign="top" class="label"> <b>Bokstavskod:</b></td> <td>${areaRF.lettercode} ${areaRF.lettercode.error}</td> </tr><TR> <td align="right" valign="top" class="label"> <b>Namn:</b></td> <td>${areaRF.areaname} ${areaRF.areaname.error}</td> </tr><tr> <td> </td> <td align="left" valign="top"> <input type="hidden" name="submit" value="submit"> <input type="submit" name="submit" value="Lägg till"> </td> </tr> </TABLE> ${areaRF.end} <H1>Distrikt</H1> <table> <tr> <th align="left">Nummer</th> <th align="left">Förkortning</th> <th align="left">Namn</th> </tr> #for $row in $districts <tr> <td align="left">${row.id}</td> <td align="left">${row.shortname}</td> <td align="left">${row.name}</td> <td align="left"> #if 0 == $row.noofmembers and 0 == $row.noofsubsocieties <a href="SystemConfig?deletedistrict=$row.id">Radera</a> #else <font color="grey">Kan ej raderas</a> #end if </tr> #end for </table> <P> Om ett distrikt ej kan raderas beror det på att det finns föreningar eller distriktsmedlemmar i distriktet. <H3>Lägg till distrikt</H3> ${districtRF.start} <TABLE> <tr> <td align="right" valign="top" class="label"> <b>Nummer:</b></td> <td>${districtRF.districtid} ${districtRF.districtid.error}</td> </tr><TR> <td align="right" valign="top" class="label"> <b>Förkortning:</b></td> <td>${districtRF.shortname} ${districtRF.shortname.error}</td> </tr> <TR> <td align="right" valign="top" class="label"> <b>Namn:</b></td> <td>${districtRF.districtname} ${districtRF.districtname.error}</td> </tr> <tr> <td> </td> <td align="left" valign="top"> <input type="hidden" name="submit" value="submit"> <input type="submit" name="submit" value="Lägg till"> </td> </tr> </TABLE> ${districtRF.end} --snap-- (Might be less understandable if you don't know swedish :) ) The 'defaultFormDefinition' argument is confusing me - perhaps FunFormKit can only do one form per page at a time? Or am I doing something else wrong? The forms both render nicely and work as they should, except for errorhandling. Regards, \EF -- Erik Forsberg http://www.lysator.liu.se/~forsberg/ GPG/PGP Key: 1024D/0BAC89D9 <for...@ly...> Key Fingerprint: B308 87FC 566E 825A 5ABC 247C AC9B AB14 0BAC 89D9 |
From: Ian B. <ia...@co...> - 2002-01-30 20:01:13
|
On Wed, 2002-01-30 at 11:46, Martin Doudoroff wrote: > First, thanks for your FFK library! We've been using FFK with our Webware > projects over the last 6 months or so. It works. > > We are experiencing a recurrent frustration, however. It's hard to explain, > but to us your solution to hooking FFK into running servlets seems > unorthodox from a Webware perspective. This seems to be causing us confusion > whenever we revisit our FFK-enabled servlets. Can you clarify for us why you > integrate FFK by overwriting output methods, rather than having it do its > thing in awake()? Is there some subtle benefit that we're overlooking? (This > may just be a confusion of different methodologies. We try to keep "stuff > that builds state" in awake() and keep "stuff that makes html" in > outputXXX() methods.) As I've been using awake() more myself, I've also recognized this problem. I haven't thought of any good alternative, however, because FFK needs to be able to render as well as process. In the case when someone submits an invalid form, FFK needs to intercept that and go to the method that writes the form -- it can't be overriding awake() at that point. If it is valid, FFK needs to redirect to some method based on how it was submitted. Anyway, I guess FFK could override awake(), but it would still have to override some rendering method as well. That just seems more complicated, without having changed anything significant. So while I'm not terribly excited about how FormServlet works, I haven't thought of anything better yet. One thing I think I want to change is to use more default naming, so setting up a form is easier as long as you do it conventionally. > Another question: have you considered adapting FFK so that it can -- when > appropriate -- produce XHTML compliant tags? It would be nice if FFK could > read the self.writeDocType() or something to determine what kind of tags to > build. The actual requirements for adding XHTML tag support to FFK are > pretty simple. For XHTML, > > - replace use of tables with divs in compound field classes Why's that? It seems like divs would be hard for minor layout -- actually, there's no fields that use tables anyway. .htFormTable() is just a convenience function. If there's other ways of doing basic layout, then they should just be different functions. > - make sure all tag attributes are quoted That would be fine for all fields. > - eliminate use of tag attributes that are deprecated in XHTML Are there particular ones you are thinking of? > - close all one-off tags, such as <br /> and <img /> and <input /> This is the only place that seems weird... I suppose browsers generally don't care. I guess it would be fine, since I can't think of any real negative. > The main question would be the "preferable" way to implement it, be it by > alternate methods or some sort of tag dictionary look-up. What do you think? Externally, the cleanest way seems to be making XHTML-generating subclasses. Otherwise, it should be passed through the options dictionary -- potentially FormServlet could automatically add that option by looking at the doc type. Ian |
From: Martin D. <ma...@pa...> - 2002-01-30 17:45:41
|
Hi Ian. First, thanks for your FFK library! We've been using FFK with our Webware projects over the last 6 months or so. It works. We are experiencing a recurrent frustration, however. It's hard to explain, but to us your solution to hooking FFK into running servlets seems unorthodox from a Webware perspective. This seems to be causing us confusion whenever we revisit our FFK-enabled servlets. Can you clarify for us why you integrate FFK by overwriting output methods, rather than having it do its thing in awake()? Is there some subtle benefit that we're overlooking? (This may just be a confusion of different methodologies. We try to keep "stuff that builds state" in awake() and keep "stuff that makes html" in outputXXX() methods.) Another question: have you considered adapting FFK so that it can -- when appropriate -- produce XHTML compliant tags? It would be nice if FFK could read the self.writeDocType() or something to determine what kind of tags to build. The actual requirements for adding XHTML tag support to FFK are pretty simple. For XHTML, - replace use of tables with divs in compound field classes - make sure all tag attributes are quoted - eliminate use of tag attributes that are deprecated in XHTML - close all one-off tags, such as <br /> and <img /> and <input /> The main question would be the "preferable" way to implement it, be it by alternate methods or some sort of tag dictionary look-up. What do you think? Martin Doudoroff & Matt Feifarek |