이 콘텐츠는 선택한 언어로 제공되지 않습니다.
24.2.2. Seam.Component
The
Seam.Component JavaScript object provides a number of client-side methods for working with your Seam components. The two main methods, newInstance() and getInstance() are documented more thoroughly in the sections following. The main difference between them is that newInstance() will always create a new instance of a component type, and getInstance() will return a singleton instance.
24.2.2.1. Seam.Component.newInstance() 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Use this method to create a new instance of an entity or JavaBean component. The object returned will have the same getter/setter methods as its server-side counterpart. You can also access its fields directly. For example:
To create a client-side Customer you would write the following code:
var customer = Seam.Component.newInstance("customer");
var customer = Seam.Component.newInstance("customer");
From here, you can set the fields of the customer object.
customer.setFirstName("John"); // Or you can set the fields directly
// customer.lastName = "Smith";
customer.setFirstName("John"); // Or you can set the fields directly
// customer.lastName = "Smith";