Hey Stefan, thanks for your response. What I was actually trying to accomplish is to use as much of what Roo generated. So posting my entity would use the POST request mapping generated by Roo in the controller's generated ITD. I managed to accomplish what I was looking for without making an extra AJAX request first for an encoded ID. I found some Dojo functions that allow me to encode in Base64. Here's the resulting JavaScript code.
Code:
var id = {};
id.userCode = dojo.byId("userCode").value;
id.entryTime = new Date().getTime();
dojo.byId("id").value = dojox.encoding.digests.wordToBase64(dojox.encoding.digests.stringToWord(dojo.toJson(id)));
//then do dojo.xhrPost()
So first I'm creating an id object and populating it. Then using a couple Dojo functions, I first convert the object to JSON, then encode it to Base64. Finally setting the value of a hidden input field who's id="id" to the resulting encoded string. Then when I perform my xhrPost to post the form, the id field contains the encoded composite key which gets converted back on the server. Resulting in a my record successfully being persisted.
One thing I might customize though is the POST request mapping. Since the Roo generated one actually returns a redirect to view the entity that was just persisted, I might create my own mapping which just returns a ResponseEntity with an HttpStatus of 201 CREATED and no body.