July 2007 Entries
This took me quite a while...I had a form that was successfully binding using the SmartDispatchController's DataBind attribute to my 'User' object. But when I tried to use the ARDataBind attribute, none of my form data was hydrating my object. There wasn't an exception thrown or anything so I couldn't figure out where the heck the problem lay.
Finally, I saw in the docs...
ErrorList errors = GetDataBindErrors(myObject);
as a way of accessing any errors that were caused during databinding.
So I stuck this bit of code in the relevant Controller method and finally saw what the issue was.
As usual, it was due to assembly clashes since I am using Oren's Rhino Commons and the most recent build from the Castle build server. I love working with all this but sometimes the assembly clashes get annoying...but these are minor considering how much easier it is work with this framework.
It turns out I have an assembly that is looking for Nhibernate 1.2.0 and I have NHib 2.0 ... seems to be a recurring theme today...
This is noobie info for Castle's Active Record but I didn't see it explicitly in the docs after a cursory look so I thought I'd point it out here. It's so common it might help someone.
If you are implementing layer superclass for your domain and want to persist properties like 'Id' from that superclass, you might try this:
[ActiveRecord]
public abstract class Identifiable<T> : ActiveRecordBase<T>
{
private int id;
[PrimaryKey]
public virtual int Id
{
get { return id; }
set { id = value; }
}
}
If you look in your Db, you'll see a table now created for your superclass! To avoid this, simply leave off the 'ActiveRecord' attribute on the superclass.
If you are using Peter Blum's Date Package and getting the dreaded 'Page is loading...' dialog box after a callback in an Update Panel containing date controls, be sure that the first UpdatePanel you are registering with his AjaxManager has its UpdateMode set to 'Always'. This IS documented and I overlooked this bit.
Unfortunately, the DatePackage and Validation (VAM) package AjaxManagers operate differently so it took me a bit to figure out how to work with the Date Package. It's a bit clumsier. I am hoping the next full version of his controls will have Ajax handling baked in rather than having it feel like an unwanted guest at dinner.
Two things that, if I don't stop typing them, will force me into early retirement:
pubic class MyClass{...}
and
<property name="prop" access="field.camelcase-underwear"/>
I'm not sure what a pubic class would be but that's a visibility I'd rather not have.
The builtin report viewer control from MS requires ViewState to be on to work. You'll get told this if you have your ViewState turned off (as it should be). Now, you can go into your page and EnableViewState='true' like a good boy, but remember that if you are using a MasterPage you must explicitly enable view state for that too...Why? Both are just controls and of course you can have view state on for some controls and off for others. That, plus the granularity of control over this beast of ViewState is ridiculous.
I never will understand why control developers assume everyone uses or LIKES to use ViewState.
One nice thing about getting in SSRS 2005 is you can fairly quickly being creating reports that look decent. Unfortunately, once you have to create ALOT of reports it becomes horrible. Two main gripes that are really what I think would be standard practice in UI/UX practices:
- Let me work mouseless...there isn't even an ALT option for the "OK" button in dialogs. Very lame. I am constantly having to grab the mouse for trivial tasks which makes the friction level higher if you are a developer who works in CODE most of the time.
- Default format settings....I can't for the life of me figure out where to alter default font/format/whatever options for 'controls' I drag on the page. I am sure there is a way but it isn't intuitive. So now I have to change font sizes to 8pt, padding:0, and so on FOR EACH CONTROL I DRAG ON. Maybe I am missing something but this seems like an obvious oversight.
So, assuming my company wants to stick out with SSRS how do you get around this goofy designer? I feel like I am eating through a straw with this thing. How about a reasonalbly priced reporting solution? Any favorites you have that won't make our company go broke?
I needed to place two new projects under svn version control and while i was working on it I thought i would go in an clean up some old garbage since when i first setup svn here was the first time I had ever even worked with it. Now one year later I am much more comfortable with it and am resetting everything up.
This included updating to SVN 1.4.4 and also choosing the fsfs file system setup instead of Berkeley.
I was able to get things going with subversion but my Apache 2.0 web server wasn't able to access it. I thought maybe I was supposed to use Apache 2.2, but that isn't it. So i dug into the error log in the Program Files/Apache/logs directory and saw this error:
(20014)Error string not specified yet: Expected format '3' of repository; found format '5'
It was obvious that this either a versioning issue between Apache and SVN or maybe because I am using the new file system type. Either way, I finally found this forum posting that helped me fix it. I needed to update the Apache modules from the new Subversion installation.
- Go into the C:\Program Files\Subversion\bin directory and grab the two *.so Apache modules
- mod_authz_svn.so
- mod_dav_svn.so
- Replace the same modules in the C:\Program Files\Apache Group\Apache2\modules directory with these two
- Place hair back on head.
Mike
Took me a while to track this down tonight. I thot that the HtmlHelper.Form would default to a POST method and so didn't explicitly declare it as such. Therefore, when I did this (using Brail):
${HtmlHelper.Form('new.rails',{'enctype':'multipart/form-data'})}
${HtmlHelper.LabelFor('photo','Title:')}
<br />
${HtmlHelper.InputFile('photo')}
<br />
${HtmlHelper.EndForm()}
I kept getting complaints from the Controller saying it couldn't convert 'String' into an 'HttpPostedFile' object.
It turns out that I needed to include a 'method="post"' explicitly in my form helper. I'm sure its a rookie mistake but still not much info to figure it out. Now it is this:
${HtmlHelper.Form('new.rails',{'method':'post','enctype':'multipart/form-data'})}
${HtmlHelper.LabelFor('photo','Title:')}
<br />
${HtmlHelper.InputFile('photo')}
<br />
${HtmlHelper.EndForm()}
And it works...
I was glad to find this is a Bug in firefox after making ajax calls. Should be fixed in 3.0.