cubicweb.edition.js — CubicWeb 3.13.2

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »
- Javascript »
- <no title> »

# cubicweb.edition.js

Functions dedicated to edition.

> organization: | Logilab
> copyright: | 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
> contact: | http://www.logilab.fr/ – mailto:contact@logilab.fr

`cubicweb.edition.js.` `setPropValueWidget`(varname, tabindex)

called on CWProperty key selection: - get the selected value - get a widget according to the key by a sync query to the server - fill associated div with the returned html

- varname, the name of the variable as used in the original creation form
- tabindex, the tabindex that should be set on the widget

`cubicweb.edition.js.` `reorderTabindex`(start, formid)

this function is called when an AJAX form was generated to make sure tabindex remains consistent

`cubicweb.edition.js.` `_showMatchingSelect`(eid, divNode)

- divNode, a jQuery selection

`cubicweb.edition.js.` `buildPendingInsertHandle`(elementId, element_name, selectNodeId, eid)

this function builds a Handle to cancel pending insertion

`cubicweb.edition.js.` `buildPendingDeleteHandle`(elementId, eid)

this function builds a Handle to cancel pending insertion

`cubicweb.edition.js.` `addPendingDelete`(nodeId, eid)

- nodeId, eid_from:r_type:eid_to

`cubicweb.edition.js.` `cancelPendingDelete`(nodeId, eid)

- nodeId, eid_from:r_type:eid_to

`cubicweb.edition.js.` `togglePendingDelete`(nodeId, eid)

- nodeId, eid_from:r_type:eid_to

`cubicweb.edition.js.` `addInlineCreationForm`(peid, petype, ttype, rtype, role, i18nctx, insertBefore)

makes an AJAX request to get an inline-creation view’s content * peid, the parent entity eid

- petype, the parent entity type
- ttype, the target (inlined) entity type
- rtype, the relation type between both entities

`cubicweb.edition.js.` `removeInlineForm`(peid, rtype, role, eid, showaddnewlink)

removes the part of the form used to edit an inlined entity

`cubicweb.edition.js.` `removeInlinedEntity`(peid, rtype, eid)

alternatively adds or removes the hidden input that make the edition of the relation rtype possible between peid and eid * peid, the parent entity eid

- rtype, the relation type between both entities
- eid, the inlined entity eid

`cubicweb.edition.js.` `unfreezeFormButtons`(formid)

unfreeze form buttons when the validation process is over

`cubicweb.edition.js.` `freezeFormButtons`(formid)

disable form buttons while the validation is being done

`cubicweb.edition.js.` `postForm`(bname, bvalue, formid)

used by additional submit buttons to remember which button was clicked

`cubicweb.edition.js.` `setFormsTarget`(node)

called on load to set target and iframeso object.

Note

this is a hack to make the XHTML compliant.

Note

object nodes might be a potential replacement for iframes

Note

there is a XHTML module allowing iframe elements but there is still the problem of the form’s target attribute

`cubicweb.edition.js.` `validateForm`(formid, action, onsuccess, onfailure)

called on traditionnal form submission : the idea is to try to post the form. If the post is successful, validateForm redirects to the appropriate URL. Otherwise, the validation errors are displayed around the corresponding input fields.

### Navigation

- index
- modules |
- next |
- previous |
- CubicWeb 3.13.2 »
- Web side development »
- Javascript »
- <no title> »