dw.web
Class FormGroup
Object
dw.web.FormElement
dw.web.FormGroup
The class is the central class within the whole form handling. It is the container element for fields and other form elements. A form group can contain other forms, also called sub-forms. Access to the elements of a form is provided via an index based access or via an associative array access. For example, the field "firstname" can be accessed with the expression "myform.firstname".
All Known Subclasses
Properties
childCount  :  Number  (Read Only)
The number of elements in the form.
error  :  String  (Read Only)
A form-wide error message. If no error message is present the method returns null.
object  :  Object  (Read Only)
The object that was bound to this form group.
submittedAction  :  FormAction  (Read Only)
The action that was submitted with the last request. The action is set independent whether the form must be valid for this action. The method returns null if no action at all was submitted with the last request for this form group.
triggeredAction  :  FormAction  (Read Only)
The action that was triggered with the last request. An action is only marked as triggered if the constraints regarding form validation are meet. The method returns null if no action was marked as triggered.
Constructor Summary
This class does not have a constructor, so you cannot create it directly. To get an instance of this class, use one of the subclass constructors.
Method Summary
accept() : void
The method copies the value from a form into the object, which was previously bound to the form.
copyFrom(obj : Object) : void
The method updates the form with the values from the given object.

The method call is basically equivalent to the pipelet UpdateFormWithObject.

The method not only copies the value, it also binds the object to the form.
copyTo(obj : Object) : void
The method updates the object with the values from the form.

The method call is basically equivalent to the pipelet UpdateObjectWithForm.

The method needs a submitted form.
getChildCount() : Number
Returns the number of elements in the form.
getError() : String
Returns a form-wide error message.
getObject() : Object
The object that was bound to this form group.
getSubmittedAction() : FormAction
Returns the action that was submitted with the last request.
getTriggeredAction() : FormAction
Returns the action that was triggered with the last request.
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.

Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβ€”passing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβ€”this is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?

This isn't just another prep courseβ€”it's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.

The Salesforce B2C Commerce Architect certification is a whole different gameβ€”complex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Method Detail
accept
accept() : void
The method copies the value from a form into the object, which was previously bound to the form. The method is equivalent to the pipelet AcceptForm. This method is equivalent to the call formgroup.copyFrom( formgroup.object ).

copyFrom
copyFrom(obj : Object) : void
The method updates the form with the values from the given object.

The method call is basically equivalent to the pipelet UpdateFormWithObject.

The method not only copies the value, it also binds the object to the form. Binding means that the form keeps the information from which objects the values were taken. This can be used for two purposes:
  1. for lists it makes it easier in the code to find the associated object, for example in case of a related action, and
  2. it allows to copy back the values from the form into the object (see accept()).
Because of this bind behavior, the operation is also sometimes called a bind-operation.
Parameters:
obj - the object from, which the values are read

copyTo
copyTo(obj : Object) : void
The method updates the object with the values from the form.

The method call is basically equivalent to the pipelet UpdateObjectWithForm.

The method needs a submitted form. The copyTo call is delegated to the form fields. Each form field than checks if its value was submitted as part of the form:
  • If this is true, the object gets updated with the form field value.
  • If this is false, the object will not be updated.
This is the reason why you cannot copy values from one object into another object by using copyFrom(Object) and copyTo(Object) within the same request (e.g. by one call to a script or controller).
Parameters:
obj - the object, which is updated from the form

getChildCount
getChildCount() : Number
Returns the number of elements in the form.
Returns:
the number of elements in the form.

getError
getError() : String
Returns a form-wide error message. If no error message is present the method returns null.
Returns:
a form-wide error message or null.

getObject
getObject() : Object
The object that was bound to this form group.
Returns:
the bound object.

getSubmittedAction
getSubmittedAction() : FormAction
Returns the action that was submitted with the last request. The action is set independent whether the form must be valid for this action. The method returns null if no action at all was submitted with the last request for this form group.
Returns:
the action that was submitted with the last request or null.

getTriggeredAction
getTriggeredAction() : FormAction
Returns the action that was triggered with the last request. An action is only marked as triggered if the constraints regarding form validation are meet. The method returns null if no action was marked as triggered.
Returns:
the action that was triggered with the last request.

β™₯
Notifications pending to read