Form API

Table of Contents

Form API

The Form APIs allow developers access to the specialized types of form submission (e.g. partial, full, single) and processing (clear, reset) provided by ICEfaces.

The following Form APIs are available:



ice.ace.clearForm(form)

Accepts a form element ID or the form node itself. By calling this function, all ACE, MOBI and standard components in the form will have their values cleared. This means that text entry components will simply contain the empty string; radio controls and checkboxes will be unchecked; selection components will return to an unselected state; ace:dateTimeEntry will have its date selection removed, if any; ace:fileEntry will return to a state where no file has been specified; ace:sliderEntry will be set to its minimum value; and mobi:flipswitch will be set to off. Note that for mobi:dateSpinner and mobi:timeSpinner, the values in the text boxes will be cleared but the values in the spinner controls will be left where they were.

Note that the namespace for this function is ice.ace.

Usage:

ice.ace.clearForm(form);

Parameters:

  • form

    The ID of the form or the form node itself


ice.ace.resetForm(form)

Accepts a form element ID or the form node itself. By calling this function, all ACE and MOBI components in the form will have their values reverted to the values they had when they were first loaded on the page. Standard components will have their values reset, as when calling the native reset() function, which simply sets the components to the value that is hard-coded in the markup. If the markup changes or is updated, the reset value might change as well for these components.

Note that the namespace for this function is ice.ace.

Usage:

ice.ace.resetForm(form);

Parameters:

  • form

    The ID of the form or the form node itself


ice.se(event, element) and ice.ser(event, element)

These functions submit a single element rather than all the elements of the form. This kind of submission reduces the elements serialization overhead and also increases the communication efficiency with the server.

Usage:

ice.se sends javax.faces.partial.execute=@this and javax.faces.partial.render=@all along with the serialized element and event.

ice.se(myEvent, theSubmittingElement);

ice.ser sends javax.faces.partial.execute=@this and javax.faces.partial.render=@this along with the serialized element and event.

ice.ser(myEvent, theSubmittingElement);

Parameters:

  • event

The event captured by the event handler.* element

The element owning the event handler.


ice.submit(event, element) or ice.s(event, element)

This is the full submit function that behaves much like a traditional form submission where all form items are posted to the request.

Usage:

ice.s sends javax.faces.partial.execute=@all and javax.faces.partial.render=@all along with the serialized elements and event.

ice.submit(myEvent, theSubmittingElement);

Parameters:

  • event

The event captured by the event handler.* element

The element owning the event handler.


Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2018 ICEsoft Technologies Canada Corp.