Good news! The invoicing application I’ve been working on now has a properly implemented method to render any category of the invoice that I need. This means that I can add, delete, and reorder entire sections of the invoice in the web browser without having to refresh. I’ve been dicking around with this method for the last week. Today, I decided to come into the office and just rewrite the damned thing. After about two hours, I now have a working render method. My biggest hang up was debugging an error where the only part of the error message that I could read said that there was a problem on line -1. Not useful.
The way that rendering was done in the last version of the application was based on lambda expressions. I had a spinner which would execute any lambda expression I wanted on it. That meant that I could call the spinner and tell it to output the entire invoice, just the categories in a formatted select list, or any number of other output options I could think of. That’s flexible, but it’s way too much for what I’m doing and makes it very difficult to find out where my errors are from the AJAX toolkit I’m using.
The refresh button that I’ve implemented on the invoice editor really doesn’t do a lot of good. If I edit something in a category in the database and hit refresh, I can see the changes without having to reload the entire web page and reorient myself; that’s a pretty unlikely scenario, though. The power isn’t in the refresh button, though. Now, if something is added, I just execute the logic to do the add and run the render routine. The same will go for anything that happens to a category, so one of two hard parts with dealing with categories is taken care of. The other is reassigning a parent. I may not allow that from the screen, because there isn’t a clean way to do it.