On 5/15/07, Simon Laws <[EMAIL PROTECTED]> wrote:
Hi Ant
Just tried this out. Pretty cool demo. Quite a big bang for a minimal
amount
of code. Very cryptic though. Still looking at it to try and work out how
it
does it. Not a sample for the beginner.
Shouldn't this be binding.dwr rather than binding.ajax. Ajax is such a
generic term that it applies to lots of technologies/protocols. Also a lot
of the magic here is DWR rather than Tuscany and I expect (though I
haven't
looked) that it's fairly DWR specific.
Simon
Is it still cryptic, i've really tried to make it as simple as possible, i
guess a readme would help. Its really just:
Include the Tuscany script in the html:
<script type="text/javascript" src="SCA/SCADomain/scaDomain.js"></script>
then other scripts in the html can make rpc style requests to the server by
using the service name from the SCDL service which uses <binding.ajax>:
ChatService.chat(msg);
and any SCDL references with <binding.ajax> cause the server to invoke the
function on the browser client, so the html needs to define in a script a
function using reference name and each possible operation:
ChatReference.chat = function(msg) {
var chatLog = document.getElementById('chatLog');
chatLog.innerHTML = msg + '<br>' + chatLog.innerHTML;
}
Then to activate the async operation you need to call scaDomain.open()
somewhere, eg:
<body onLoad="scaDomain.open()">
Not sure what to call the binding, its not really specific to DWR - the
client knows nothing of DWR as its all wrappered in the scaDomain.js, and we
could use other things like jsonrpc to do this, just DWR made it really easy
to implement.
...ant