You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/classic-ui/forms.md
+63-11Lines changed: 63 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,9 @@ Fields, Widgets, Vocabularies aso are descripted in detail in there own chapter
18
18
19
19
20
20
Plone uses the [z3c.form](http://pythonhosted.org/z3c.form) library to build its web-forms.
21
-
The package responsible for integrating with Plone is [plone.z3cform](http://pypi.python.org/pypi/plone.z3cform).
21
+
The package responsible for integrating with Plone is [plone.z3cform](http://http://github/plone//plone.z3cform).
22
22
23
-
To simplify the process of organizing a form and specifying its widgets and fields, Plone utilizes [plone.autoform](http://pypi.python.org/pypi/plone.autoform), in particular its `AutoExtensibleForm` base class.
23
+
To simplify the process of organizing a form and specifying its widgets and fields, Plone utilizes [plone.autoform](http://github/plone/plone.autoform), in particular its `AutoExtensibleForm` base class.
24
24
It is responsible for handling form hints and configuring z3c.form widgets and groups (fieldsets).
25
25
26
26
A form is a view that utilizes these libraries.
@@ -105,21 +105,32 @@ class MyForm(AutoExtensibleForm, form.EditForm):
105
105
## Dexterity Add- and Edit forms
106
106
107
107
Dexterity content types are coming with default add and edit forms.
108
-
You can build custom add and edit forms if you need.
108
+
You can build custom add and edit forms to adjust there behavior.
109
+
110
+
The implementation of the default edit and add forms is in [plone.dexterity.browser.edit.py](https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/browser/edit.py) and [plone.dexterity.browser.add.py](https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/browser/add.py).
111
+
112
+
109
113
110
114
111
115
```{todo}
112
116
Describe Add/Edit forms here and how to customize them.
117
+
Provide mutiple examples.
113
118
```
114
119
115
120
116
121
### Disable form tabbing
117
122
118
-
To disable the form tabbing, you have to override the form and provide a property enable_form_tabbing which is False.
123
+
To disable the form tabbing, you have to override the edit and add forms and provide a property enable_form_tabbing which is False.
119
124
120
-
The Python code `custom_edit_form.py` should look like this:
125
+
The Python code `custom_forms.py` should look like this:
121
126
122
127
```python
128
+
from plone.dexterity.browser import add
129
+
from plone.dexterity.browser import edit
130
+
from zope.interface import implementer
131
+
from zope.interface import Interface
132
+
133
+
123
134
classICustomEditForm(Interface):
124
135
"""
125
136
"""
@@ -130,9 +141,30 @@ class CustomEditForm(edit.DefaultEditForm):
130
141
"""
131
142
enable_form_tabbing =False
132
143
144
+
145
+
classICustomAddForm(Interface):
146
+
"""
147
+
"""
148
+
149
+
150
+
@implementer(ICustomAddForm)
151
+
classCustomAddForm(add.DefaultAddForm):
152
+
""" Custom add form disabling form_tabbing
153
+
"""
154
+
enable_form_tabbing =False
155
+
156
+
157
+
classICustomAddView(Interface):
158
+
""""""
159
+
160
+
161
+
@implementer(ICustomAddView)
162
+
classCustomAddView(add.DefaultAddView):
163
+
form = CustomAddForm
164
+
133
165
```
134
166
135
-
to activate it, you have to override the registration of the edit form for your desired content types.
167
+
to activate them, you have to override the registration of the forms for your desired content types.
0 commit comments