Showing posts with label gotcha. Show all posts
Showing posts with label gotcha. Show all posts
Friday, February 29, 2008
Gotcha: Grails Auto Recompile Doesn't Do GSP
Grails does the auto recompile thing, much like Turbogears etc., but it doesn't seem to work for gsp pages, in particular, main.gsp. Which can trip you up, if you're trying to make a couple simple changes to your first Grails app.
Wednesday, July 25, 2007
Gotcha: Turbogears urls
So, this didn't really waste too much of my time, but watch for trailing slashes in your links. If you have a setup like (Stolen from the SimpleFormsWidgetTutorial):
And, for whatever reason, your user ends up at "host.com/add/" instead of "host.com/add", the form will display fine, but will point to "host.com/add/save" instead of "host.com/save". Then you'll get all kinds of fun errors, like "TypeError: add() got an unexpected keyword argument ''", and you'll scratch your head, wondering if you got an error that the validation somehow threw and the form error handler somehow didn't catch. Or, at least, I did.
comment_form = widgets.TableForm(
fields=CommentFields(),
action="save"
)
@expose(template=".templates.form")
def add(self, tg_errors=None):
if tg_errors:
flash("There was a problem with the form!")
return dict(form=comment_form)
@expose()
@validate(form=comment_form)
@error_handler(add)
def save(self, **data):
#...
And, for whatever reason, your user ends up at "host.com/add/" instead of "host.com/add", the form will display fine, but will point to "host.com/add/save" instead of "host.com/save". Then you'll get all kinds of fun errors, like "TypeError: add() got an unexpected keyword argument '
Tuesday, July 10, 2007
Gotcha: C# Windows.Forms Madness
So, if you are ever creating dynamic forms in C#, and things aren't showing up for some reason, and you sillily left one non-dynamic thing there, just to be sure that you're not loosing the whole container, check that the dynamic stuff isn't being created underneath other things. For some reason, I expect them to show up over older stuff, but apparently I'm wrong. (I.E. set form.Location = new System.Drawing.Point( [not 0], [also not 0]); )
[Spell check doesn't think that sillily is a word. Pssht.]
[Spell check doesn't think that sillily is a word. Pssht.]
Subscribe to:
Posts (Atom)