You can use attributes to customize web-based two-way forms.
The Communication Enabled Applications (CEA) two-way form widget is used to create HTML forms in which two people can collaboratively input text and validate entries. Both users can see the same form. The fields in the form change in response to input provided by either person.
The writer is the user who is responsible for driving the interaction between the two users.
The reader is the user who is responsible for providing information to the writer. The reader can provide information verbally to the writer, who copies the information into the form's fields. Since updates to the fields are visible to the reader, the reader can confirm or validate the correctness of the information. The reader can be prompted to enter sensitive information into the form, such as credit card numbers. Such private information is generally filtered so that the writer cannot see it.
Any Dijit form widgets and their subclass widgets that are part of a two-way form automatically support two-way editing. A widget supporting two-way editing must have an ID specified. You can specify additional attributes on the widgets to expand their capabilities.
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabWriteAccess="reader" />
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabWriteAccess="writer" />
The ceaCollabFilter attribute is used to specify a JavaScript method that is used to mask values. This is useful for fields that contain sensitive information that only one user should be allowed to see (for example, Social Security numbers). If the attribute has the value default, a default masking function is used that replaces every character of input with an asterisk. Otherwise, the value of the attribute is used to call a method that takes a string (the value of the input field) and is expected to return a masked version of that value.
function mask(value) { return "XXXX"; }
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabFilter="mask" />
Two-way form functionality allows for validation to occur on any input field. This means that any change to the input field by one user will require another user to accept or decline the changes. You can submit the form only after all input fields that require validation have been accepted.
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabValidation="default" />
In some cases, you might not want to use the default validation widget. You can create your own by subclassing cea.widget.validation.ValidationWidget and overriding methods related to creating, showing, and hiding the validation widget. For more information about how a custom class is implemented, see the JavaScript comments in app_server_root\etc\cea\javascript\ceadojo\cea\widget\validation\ValidationWidget.js.
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabValidation="default" />
function removeFunc(widget) { ceadijit.hideTooltip (widget.domNode); } function showFunc(widget) { ceadijit.showTooltip ("Value changed", widget.domNode); }
<input type="text" name="textName" id="textName" value="" size="30" ceadojoType="dijit.form.TextBox" ceaCollabHandleRemoveNotification="removeFunc" ceaCollabHandleShowNotification="showFunc" />