PoNG Module: Modal Form Dialog

Aus MH
Wechseln zu: Navigation, Suche

This module enables you to use forms in modal dialogs in PoNG.

Typically you can add a configuration dialog to your resource view. You only have to define the fields of the configuration form, that's it.

Please have a look at the other standard modules coming with PoNG.

Usage in "structure"

Simply add a action to the actions array with "type": "modal-form"

Example structure file extract:

{
  "layout": {
     ...
     "rows": [
     {
       "rowId": "bla",
       "resourceURL": "XYZ",
       ...
       "actions" : [ { "actionName": "Config", "type": "modal-form" }, ... ]
     },
     ...
   ],
   ...
}

Definition of the form

This modal-form module will then generate a form. The field definition is loaded from the URL ../svc/XYZ/modal/Config/meta

Example definiton from ../svc/<resourceUrl/modal/<actionName>/meta

{
   "propertiesList" : [
       { "name" : "a", "type" : "text", "label": "Bla" },
       { "name" : "b", "type" : "int", "label": "Blub" }  
   ], 
   "width": "800", 
   "height": "600"
}

Available types:

  • text
  • password
  • int
  • textarea

Result:

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden

Interaction with the resource

The values are loaded with a GET call to ../svc/<resourceUrl/modal/<actionName>?<name>. Name is the value of name in the properties list.

The form will submit its values using POST to ../svc/<resourceUrl/modal/<actionName>.