Create New Button.

The edit configurations we have seen so far are presented to the user via the view configuration item.

There is a button that can be added to a tool bar or status bar which will immediately initiate the creation of a new object.

Immediately on clicking the button, the creation of a new spatial object for the nominated entity is commenced. The createNew configuration item includes the entity whose geometry is to be created, and the spatial edit configuration to be used; if a spatial edit configuration is not provided, the default editor is used. The entity subject to the createNew action is set to being active.

<item action="weave.edit.createNew" entity="grafitti"/>

or it takes an entity and a specific edit, in which can that edit will be used,

<item action="weave.edit.createNew" entity="graffiti" edit="default.edit"/>

Here is that section of our Weave client that implements this item.

<view id="com.cohga.html.client.map.mapView"> <location>map</location> <label>Melbourne</label> <crs>EPSG:3857</crs> <toolbar> <item action="weave.fixedZoomIn"/> <item action="weave.fixedZoomOut"/> <item action="weave.fullExtent"/> <item action="weave.zoomIn"/> <item action="weave.zoomOut"/> <item action="weave.pan" isDefault="true"/> <item>-</item> <item action="weave.toggleToolbar" iconCls="icon-polygon" align="tl-bl" hideOnClick="true"> ... </item> <item action="weave.edit.createNew" entity="graffiti" edit="final.edit"/> </toolbar> .... </view>

Which looks like the following.

Create New Button

Note that the final.edit Edit Configuration is created later on in Examples of Parameter Customisations (See section Example: Using Check Boxes and Radio Buttons)