예제 #1
0
    def form_view(self, ctx):

        def changeView(ctx, form, data):
            return url.here.replace('status', data['status'])

        form = xforms.Form()
        form.addField('status', xforms.String(required=True),
                xforms.widgetFactory(xforms.SelectChoice,
                    options=STATUS_OPTIONS, noneOption=None))
        form.addAction(changeView)
        form.data = {'status': ctx.arg('status')}
        return form
예제 #2
0
 def form_editChildren(self,ctx):
     """Create a form for managing the children (a tree) of this category.
     """
     children = self.node.children
     form = xforms.Form()
     if children:
         form.addField(
             'categories',
             xforms.Integer(required=True),
             xforms.widgetFactory(xforms.RadioTreeChoice, children,
                 nodeInterface=IEditableTreeNode)
             )
         form.addAction(self._submit_deleteCategory,'delete')
         form.addAction(self._submit_moveUp,'moveUp')
         form.addAction(self._submit_moveDown,'moveDown')
     return form
예제 #3
0
 def form_editChildren(self,ctx):
     """Create a form for managing the children (a tree) of this node.
     """
     children = self.original.children
     form = xforms.Form()
     if children:
         form.addField(
             'navigation',
             xforms.Integer(required=True),
             xforms.widgetFactory(treewidget.RadioTreeChoice, children, 
                 nodeInterface=ISiteMapItemTreeNode)
             )
         form.addAction(self._submit_deleteNode,'delete')
         form.addAction(self._submit_moveUp,'moveUp')
         form.addAction(self._submit_moveDown,'moveDown')
     return form