In general these will be either Seam entity or JavaBean components, or some other non-component class. Use the appropriate method (either Seam.Component.newInstance()
for Seam components or Seam.Remoting.createType()
for everything else) to create a new instance of the object.
It is important to note that only objects that are created by either of these two methods should be used as parameter values, where the parameter is not one of the other valid types mentioned anywhere else in this section. In some situations you may have a component method where the exact parameter type cannot be determined, such as:
@Name("myAction")
public class MyAction implements MyActionLocal {
public void doSomethingWithObject(Object obj) {
// code
}
}
In this case you might want to pass in an instance of your myWidget
component, however the interface for myAction
won't include myWidget
as it is not directly referenced by any of its methods. To get around this, MyWidget
needs to be explicitly imported:
<script type="text/javascript" src="seam/resource/remoting/interface.js?myAction&myWidget">
</script>
This will then allow a myWidget
object to be created with Seam.Component.newInstance("myWidget")
, which can then be passed to myAction.doSomethingWithObject()
.