-
1. Re: Component name aliasing not working with Seam remoting
dan.j.allen Jul 8, 2008 10:18 PM (in response to joerg.joerg.schneider.e-custody.de)At this time, Seam remoting requires use of the @Name annotation only for exporting a component (it has no knowledge of component definitions in components.xml).
I don't understand your problem with the names.
var manager = Seam.Component.getInstance("org.jboss.seam.core.manager");
-
2. Re: Component name aliasing not working with Seam remoting
joerg.joerg.schneider.e-custody.de Jul 9, 2008 7:35 PM (in response to joerg.joerg.schneider.e-custody.de)Hi,
the problem occurs, if not using a javascript variable, something like :
Seam.Component.getInstance(
org.jboss.seam.core.manager
).doSomething();instead of
var manager = Seam.Component.getInstance(
org.jboss.seam.core.manager
);
manager.doSomething();Can you confirm ? If so, that should be documented in the Reference Guide, since the way it is mostly described in the doc's is by not using a javascript variable and that will be a common pitfall.
Cheers, Joerg
-
3. Re: Component name aliasing not working with Seam remoting
admin.admin.email.tld Jul 10, 2008 1:56 AM (in response to joerg.joerg.schneider.e-custody.de)this is the example from the Seam 2.0.1.GA ref pdf that I used successfully as a model for my Seam remoting cases:
<script type="text/javascript"> //<![CDATA[ function sayHello() { var name = prompt("What is your name?"); Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback); } function sayHelloCallback(result) { alert(result); } // ]]> </script>
I don't think I've ever experienced the problem you're talking about.
The way it works is you replace
helloAction
above with the @Name(foobar
) value (in this casefoobar
) of your component. Why do you need to prepend any package name?What is it exactly that you're trying to achieve in your Seam remoting call?
-
4. Re: Component name aliasing not working with Seam remoting
dan.j.allen Jul 10, 2008 8:23 AM (in response to joerg.joerg.schneider.e-custody.de)I stand corrected. You have hit a bug in Seam. JBSEAM-3152
-
5. Re: Component name aliasing not working with Seam remoting
joerg.joerg.schneider.e-custody.de Jul 10, 2008 8:29 AM (in response to joerg.joerg.schneider.e-custody.de)Hi Arbi,
your code snippet works fine, since it is not referring to a java style package named Seam component, but a simple
helloAction
component. What if the name of the component is much more complex, something likecom.db.tss.core.action.HelloAction
? I'd assume if you replacehelloAction
with such a fully qualified component name it doesn't work anymore and that is exactly the problem I have.As per Seam documentation it is recommended to use java style fully qualified package naming for your Seam components - and that makes perfect sense for me, not only if you plan to develop large and complex applications. Anyhow, this fully qualified name can not be used with Seam remoting if not dereferencing the Seam component name into a javascript variable - that's my point here - and this is not documented in the Seam reference. Assigning a short name / alias to a Seam component via the factory tag in components.xml (as per Seam documentation) to overcome this issue doesn't work.
Again :
Seam.Component.getInstance("helloAction").sayHello(name, sayHelloCallback) - will work.
Seam.Component.getInstance("com.db.tss.core.action.HelloAction").sayHello(name, sayHelloCallback) - will not work.
var hello = Seam.Component.getInstance("com.db.tss.core.action.HelloAction");
hello.sayHello(name, sayHelloCallback) - will work again.Could you confirm ?
Cheers, Joerg.
-
6. Re: Component name aliasing not working with Seam remoting
joerg.joerg.schneider.e-custody.de Jul 10, 2008 8:40 AM (in response to joerg.joerg.schneider.e-custody.de)Hi,
does that mean your proposed workaround to use a javascript variable also doesn't work :
var manager = Seam.Component.getInstance("org.jboss.seam.core.manager");
manager.doSomething();
Currently we are using underscores for the SLSB bean's that act as a wrapper/facade for remoting purposes. The real components behind this beans still use the java style package names - that's working fine, even though the underscores look ugly in our code.
Since you've created a JIRA bug entry, I assume this behaviour will be corrected in a later version. If someone spents some efforts on this, would it be to much to ask for if a alias name (via the <factory> tag in components.xml) could also be supported by Seam remoting ? That would beautify our javascript a bit :-)
Thanks for your help.
Cheers, Joerg.