[Checkins] SVN: zope3org/trunk/src/zorg/multiform/ fixed some bugs
Bernd Dorn
bernd.dorn at fhv.at
Tue Apr 11 02:53:08 EDT 2006
Log message for revision 66827:
fixed some bugs
Changed:
U zope3org/trunk/src/zorg/multiform/configure.zcml
U zope3org/trunk/src/zorg/multiform/gridform.txt
U zope3org/trunk/src/zorg/multiform/multiform.py
-=-
Modified: zope3org/trunk/src/zorg/multiform/configure.zcml
===================================================================
--- zope3org/trunk/src/zorg/multiform/configure.zcml 2006-04-11 06:21:15 UTC (rev 66826)
+++ zope3org/trunk/src/zorg/multiform/configure.zcml 2006-04-11 06:53:08 UTC (rev 66827)
@@ -6,12 +6,12 @@
<adapter for="zope.app.location.interfaces.ILocation
zope.formlib.interfaces.IForm"
provides=".interfaces.IFormLocation"
- factory=".gridform.FormLocationProxy"
+ factory=".selection.FormLocationProxy"
/>
<adapter for=".interfaces.IFormLocation"
provides=".interfaces.ISelection"
- factory=".gridform.FormLocationSelection"
+ factory=".selection.FormLocationSelection"
/>
<include package=".container"/>
Modified: zope3org/trunk/src/zorg/multiform/gridform.txt
===================================================================
--- zope3org/trunk/src/zorg/multiform/gridform.txt 2006-04-11 06:21:15 UTC (rev 66826)
+++ zope3org/trunk/src/zorg/multiform/gridform.txt 2006-04-11 06:53:08 UTC (rev 66827)
@@ -70,20 +70,21 @@
... self.newInputMode = False
...
... @multiform.parentAction('Edit',
- ... condition=isSelected)
+ ... condition=isSubFormDisplayMode)
... def handle_edit_action(self, action, data):
- ... self.newInputMode = True
+ ... if isSelected(self,action):
+ ... self.newInputMode = True
...
... @multiform.itemAction(u"SingleSave",
... condition=isSubFormInputMode,inputMode=True)
- ... def handle_save_action(self, action, data):
+ ... def handle_singlesave_action(self, action, data):
... form.applyChanges(self.context, self.form_fields,
... data, self.adapters)
... self.newInputMode = False
...
... @multiform.itemAction('SingleEdit',
... condition=isSubFormDisplayMode)
- ... def handle_edit_action(self, action, data):
+ ... def handle_singleedit_action(self, action, data):
... self.newInputMode = True
@@ -121,10 +122,16 @@
<div>n1</div>
</div>
+Also the edit action should be available.
+
+ >>> print gf.subActionNames
+ [u'form.actions.edit']
+
Now we are going to select some items. And the checkbox of the ``selected``
>>> request = TestRequest()
>>> request.form['form.n1.selected']=u'on'
+ >>> request.form['form.n0.selected.used']=u''
>>> gf = OrdersForm(orderMapping,request)
>>> gf.update()
>>> print gf.render()
@@ -144,6 +151,7 @@
>>> request = TestRequest()
>>> request.form['form.actions.edit']=u''
+ >>> request.form['form.n0.selected.used']=u''
>>> request.form['form.n1.selected']=u'on'
>>> gf = OrdersForm(orderMapping,request)
>>> res = gf()
@@ -167,8 +175,9 @@
>>> #request.form['form.n1.actions.singleedit']=u''
>>> gf = OrdersForm(orderMapping,request)
>>> res = gf()
- >>> [action.__name__ for action in gf.subForms['n1'].availableActions()]
- [u'form.n1.actions.singleedit']
+ >>> sorted([action.__name__ for action in
+ ... gf.subForms['n1'].availableActions()])
+ [u'form.actions.edit', u'form.n1.actions.singleedit']
We call the singleedit to edit a single row.
Modified: zope3org/trunk/src/zorg/multiform/multiform.py
===================================================================
--- zope3org/trunk/src/zorg/multiform/multiform.py 2006-04-11 06:21:15 UTC (rev 66826)
+++ zope3org/trunk/src/zorg/multiform/multiform.py 2006-04-11 06:53:08 UTC (rev 66827)
@@ -138,8 +138,8 @@
hasErrors = False
for form in self.subForms.values():
form.update()
+ refresh = False
for form in self.subForms.values():
- refresh = False
if form.newInputMode is not None:
newInputMode = form.newInputMode
context = self.context[form.context.__name__]
More information about the Checkins
mailing list