JMap.Form.canCreateElementOnForm
Returns true if current user can create element on the given form.
parameters needed to identify the form
JMap.Form.canDeleteElementOnForm
Returns true if current user can delete element on the given form.
parameters needed to identify the form
JMap.Form.canUpdateElementOnForm
Returns true if current user can update element on the given form.
parameters needed to identify the form
JMap.Form.checkAndCorrectSchemas
Checks if the schemas are valid, corrects them when possible, throws for non-repairable errors
form data schema
form ui schema
JMap.Form.closeCurrentDisplayedDialog
Closes the currently displayed form.
Do nothing if no form displayed.
JMap.Form.createAttributeFormElement
Creates an attribute form element.
Works only for attribute form.
params needed to create a new feature
JMap.Form.createDatabaseFormEntry
Creates an external or sub form entry.
Works only for external or sub forms.
params needed to create a new entry
JMap.Form.deleteDatabaseFormEntries
Deletes entries of an attribute form.
Works only for attribute form.
params needed to delete entries
JMap.Form.getActiveTabIndex
Returns the active tab index.
If no form, or sub form is displayed, returns 0.
JMap.Form.getAllFormsMetaDataForCurrentLayer
Returns the current layer forms metadata.
If no layer form displayed, returns an empty array.
JMap.Form.getAttributeForm
Returns attribute form of currently displayed layer.
JMap.Form.getDefaultValues
Returns the default data values of the form.
The result is an object where :
Initial data. If provided, it will set the default data then overwrite with initial values.
a key/value object
JMap.Form.getDisplayedForm
Returns the currently displayed form.
Use [[JMap.Form.hasDisplayedForm()]] to know if a form is currently displayed.
JMap.Form.getDisplayedFormPhotos
Returns the photo of the currently displayed form.
JMap.Form.getElement
Returns form data of an element from given parameters.
Works only for attribute forms.
params which identify the element
JMap.Form.getElements
Returns form data of multiple elements from given parameters.
Works only for attribute forms.
params which identify the elements
JMap.Form.getEntries
Returns form data of multiple entries from given parameters.
Works only for external and sub forms.
params which identify the entries
JMap.Form.getExternalForms
Returns external forms of currently displayed layer.
an empty array if layer has no external forms
JMap.Form.getAllFormsMetaDataForCurrentLayer
Returns form metadata of the currently displayed layer and given form id.
the JMap form id
JMap.Form.getFormValues
Returns default values if form has not been edited, else form values.
This is a technical method used by JMap App, you should never have to use this function
JMap.Form.getFormsMetaDataByLayerId
Returns all forms metadata for a given layer id.
Fecthes data from server first time, then keeps it in cache for the next time.
the JMap layer id
JMap.Form.getNextViewId
Returns the next view id.
This is a technical method that you should never have to use.
JMap.Form.getPreparedData
This function prepare the data, it returns a copy object containing the values formatted in a way that fit the server needs.
It's not mandatory to use this function but it's highly recommended to use it before :
It returns another object without modifing the passed object.
Use to set the correct type (number if a string number is passed), and many other things.
The form data
the prepared data
JMap.Form.getSubForms
Returns sub forms of currently displayed layer.
an empty array if layer has no sub forms
JMap.Form.hasAttributeForm
Returns true if the currently displayed layer has an attribute form.
If no form is displayed, return false.
JMap.Form.hasDisplayedForm
Returns true if a form is currently displayed.
JMap.Form.hasDisplayedFormAPhotoField
Returns true if currently displayed form has a photo field.
JMap.Form.hasEditOwnRightsForAllElements
Returns true if current user has the right to edit all given elements.
parameters needed to identify the form
JMap.Form.incrementNextViewId
Increments the next view id.
This is a technical method that you should never have to use.
JMap.Form.isOwnPermissionRespectedForAllElements
Returns true if all given elements respect edit own permission.
Works only for attribute form elements, edit own permission are not supported for external or sub forms.
JMap.Form.openCreationDialogForLayer
Opens the form creation dialog.
the JMap layer id
the feature geometry
JMap.Form.openCreationDialogForSubForm
Opens the sub form creation dialog.
JMap.Form.openUpdateDialogForLayer
Opens the form update dialog.
the JMap layer id
the elements to update
JMap.Form.openCreationDialogForSubForm
Opens the sub form creation dialog.
JMap.Form.processRule
Processes a JSON Logic rule and returns the result, or undefined if rules are not correct.
the json logic rule
the data
JMap.Form.removeDisplayedFormPhotoById
Deletes a photo on the currently displayed form, for a given photo id.
the photo to delete
JMap.Form.resetDisplayedForm
Resets the currently displayed form.
Use [[JMap.Form.hasDisplayedForm()]] to know if a form is currently displayed.
JMap.Form.setActiveTabIndex
Set the active tab index.
Works only for attribute form that have at least one external form.
Index starts at 0 (attribute form), 1 (first external form), etc...
Use [[JMap.Form.hasDisplayedForm()]] to know if a form is currently displayed.
the tab index
JMap.Form.setFormValues
Set form values of the given form.
JMap.Form.submit
Submit the currently displayed form.
optional params
JMap.Form.updateAttributeFormElements
Updates an attribute form element.
Works only for attribute form.
params needed to update an element
JMap.Form.updateDatabaseFormEntries
Updates an external or sub form entry.
Works only for external or sub form.
params needed to update an entry
JMap.Form.updateDisplayedFormPhoto
Updates a photo to the currently displayed form.
the needed params
JMap.Form.validateData
Returns errors for the given form id and data.
If no error validation, it returns an empty object.
The result is an object where :
The form data
an empty object if no validation error, else an object containing error messages grouped by attribute id.
JMap.Form
Here you'll find all form related methods