Re: Series of questions on a simple invoice application
Aaron Reed <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Paul Everitt wrote: > > Hi all. I have a series of questions in support of building a small > invoice application, which if I succeed in doing so, I'll try to write > up a decent tutorial on how I did it. > > My questions mostly revolve around which design patterns I should use, > based on what parts are fairly stable in the nightly builds. I follow > the status updates here: > > http://www.beaufour.dk/blog/ > > ...quite frequently and find the information exceptionally useful. My > first attempt at doing this sample app in the nightly XPI 4 weeks ago > was quite frustrating. This blog helps me get a feeling on which > direction to go. (As a note, I've tinkered with XUL/chrome/RDF apps for > a few years.) > > I won't go too much into requirements, just enough to start asking > questions. Imagine a little application to browse, edit, add, and > delete invoices. For the moment, pretend the information on each > invoice is very flat and boring: invoice number, title, amount, and a > vendor from a pre-defined list. > > I must admit, I got stuck pretty quickly. :^) I needed some way to > browse around the existing list of invoices. I could do it in two basic > ways: > > 1) Tree. Use <select> and change the currently-displayed invoice for > the right event. > > 2) VCR-like. Use something like MS Access, where you have: > > << < [90____] > >> > > Handle each form control similarly to (1). > > I found that event handling never worked quite the way I expected it to. > I tried xforms-select but could never make anything happen. DOMActivate > didn't work. Even attaching an HTML event via JS didn't produce much > help (as the model appears quite opaque to the DOM). > > Based on the nightlies, what is a stable, good UI approach (select vs. a > series of <input> form elements) for browsing a series of "records"? > > What is the right way to handle an event for that UI approach, > reflecting it into the model so that another <group> of elements > automatically changes to a different bound element? > > --Paul Hey Paul, What platform are you on? Windows, Linux or Mac? If you are on Windows, I would suggest that any approach that you try with our nightly you also try with Novell's plugin or the formsPlayer plugin. There are still quite a few things we don't support yet and you may very well be taking a solid approach and it just may be that we can't handle it, yet. There are two good things that can come from this approach. The more processors that you try, the better feedback you get as to whether your understanding of XForms and the approaches that you are trying in XForms are good. I've found that if I try something and it works on two or more processors, then I am probably doing it right :=) Plus, if you code forms that work in formsPlayer and Novell, but it doesn't work in our processor then we'd love to know that so that we can work on those bugs. Having said all of that, one of the reasons that your approach isn't working right now is that we are currently only generating xforms-select events for switch elements and not for select and select1 elements. Though we do hope to be doing that soon. We are still in the process of converting select and select1 from XTF to XBL so those interfaces haven't really solidified, yet. I think that I have a good idea of what you are trying to accomplish. I'll try to write up a sample this afternoon and post it. The way that I'm thinking about it should work in all of the processors AFAIK. --Aaron