I'm looking to use Coweb in a project and just wanted to let you know the issues I've encountered so far (and solutions too).
I'm attempting to get the shopping list example working and the first thing I noticed was that the website documentation is way out of date. So I setup Sphinx on an Ubuntu VM to rebuild the docs and use those instead. Doing this means that I now get code that uses the dojo AMD mechanism.
Then I couldn't get the dojo parser code to work and scratched my head for an hour or so. Stripping it back I can up with the following changes from the given sample code that works fine for me.
define([
'dojo/parser',
'dojo/data/ItemFileWriteStore',
'coweb/main',
'dojo/domReady!',
'dijit/layout/BorderContainer',
'dijit/layout/ContentPane',
'dijit/form/Button',
'dojox/grid/DataGrid'
], function(parser, ItemFileWriteStore) {
var app = {
init: function() {
console.log("In init...");
parser.parse();
var emptyData = { identifier: 'id', label: 'name', items: [] };
this.dataStore = new ItemFileWriteStore({ data: emptyData });
this.grid = dijit.byId('grid');
this.grid.setStore(this.dataStore);
var addButton = dijit.byId('addRowButton');
var removeButton = dijit.byId('removeRowButton');
dojo.connect(addButton, 'onClick', this, 'onAddRow');
dojo.connect(removeButton, 'onClick', this, 'onRemoveRow');
},
onAddRow: function() {
var date = new Date();
var id = String(Math.random()).substr(2) + String(date.getTime());
this.dataStore.newItem({
id: id,
name: 'New Item',
amount: 0
});
},
onRemoveRow: function() {
this.grid.removeSelectedRows();
}
};
app.init();
});
One of the problems is that the cowebx package doesn't exist and so BusyDialog cannot be found. Looking through the POM file it isn't in there as a war overlay and looking on Maven Central there is only a really old version available. I'm going to try and forge ahead ignoring this class for now but is there any way I can get it from another package? The specific pom instructions would be great if they are available.