[jboss-user] [JBoss Seam] - Re: Seam and Adobe Flex
cingram
do-not-reply at jboss.com
Wed Jul 18 14:10:30 EDT 2007
FYI: If Patrick pretty cool WebService/Action library is not an option for what ever reason. The FlexAjaxbridge makes using the seam remoting(javascript) pretty easy. An example of the helloworld
| ---Html page
|
| <script src="FABridge.js" ></script>
| <script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
| <script type="text/javascript" src="seam/resource/remoting/interface.js?helloAction"></script>
|
| function sayHello(name) {
| Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback);
| }
|
|
| function sayHelloCallback(result) {
| var flexApp = FABridge.flash.root();
| var message = myActionScriptFunction(result);
| }
|
|
| ---ActionScript
|
| private function sayHello(): void {
| var f:String = "sayHello";
| ExternalInterface.call(f,txtName.Text);
| }
|
| private function sayHelloCallBack(result:String): void {
| lblName.Text = result;
| }
|
The downside is it is fairly code intensive. You could clean alot of this up by doing some dynamic javascript. The remoting js file is pretty nice as it propagates the conversation for you. I haven't quite figured out how to get a object that is returned from the server to translate in to action script properly.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065518#4065518
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065518
More information about the jboss-user
mailing list