Is this even feasible?

OK, as I've mentioned in previous posts. I'm working on creating demos of a product we develop being converted to web based.

Here's my feasibility question. We would like to create something similar to a desktop. Menubar at the top, Taskbar at the bottom, windowarea in the middle. Selecting items on the menubar opens a new window in the windowarea, taking you to the "application" that you just selected.

I've already got the basic desktop setup, the menubar, the windowarea, the taskbar. I've created a small application.

I click the menu option, and a new window opens perfectly. Now, say I need another new window of the same application, I click the menu option and get "Multiple ID occurrence" errors.

I could easily fix this by adding a key (4-digit random characters) to the end of every name & id and send that key in any processes that I need.

So my question is am I going to be working too hard to figure all this out, not to mention that CSS becomes a pain in the tail to work out because now my "ID"s will have extra characters?

Anyone have any opinions on this?

Thanks for the help I've received so far!
-David

My opinion

Hi David,

Since you're asking for opinions, I'll give you mine. Note that this really is just my opinion though, and not necessarily the best way to architect your application.

My first question would be: Do you absolutely need an ID on each window? You very well may be able to get away without using them. For instance, the "desktop" piece can simply keep an array with references to each window's controller (or simply use XPath to get a list of the window container's children). Anything inside a window, if it needs a reference to the window controller itself, should be able to do that by traversing up the tree using XPath.

Next, if you decide that you need to have IDs, I would use a sequential naming convention instead of a random one. In other words, keep a running total of how many windows have been opened and name each window "window1", "window2", "window3", etc. Using a random string always has the possibility of creating a duplicate, unless the generator is in a loop which checks for duplicates. But why do that when it's simple and performant to just keep a running total.

Next, regarding CSS, there are very, very few times when you should use an ID as a CSS selector: ie, "#window { width: 100%; }". Instead, you should use classes. Each window could have the appropriate class, say, "window" and the CSS would look like ".window { width: 100%; }". Now all your windows regardless of their ID will have the appropriate look and feel. Keep in mind that an element can have more than one class and that Backbase provides "addClass" and "removeClass" commands.

I realize I've given very broad generalizations here and there are still lots of details to work out, but from an overall design perspective, I believe these ideas will save you headaches in the future.

- James Brantly

Thank you once again

James,

I just want to personally thank you for taking the time to respond to my issues the way you have. I realize these might seem like dumb questions, but I just wanted to thank you for answering them.

I believe you are correct though, I don't necessarily need ids. Things I was thinking about were form fields, and the javascript that has to be performed on them at various times.

I see now that I need to brush up on XPath.

I'm really just trying to develop some demo apps now not even full-featured, then if this is the way we decide to go. I will probably go through some of the Backbase training classes to get the best knowledge about the backbase product.

I'm willing to hear others commments/suggestions as well.

Thanks again James,
-David