Beispiel #1
0
 def delteAll(self,
              controls,
              silent=False,
              fresh=False,
              timeout=None,
              **kwargs):
     return ClientSide.call("DynamicForm.get", controls, silent,
                            scriptURL(kwargs), timeout, fresh)
 def post(self,
          silent=False,
          timeout=None,
          fresh=False,
          params=None,
          **kwargs):
     return ClientSide.call("DynamicForm.post", self, silent, params
                            or scriptURL(kwargs), timeout, fresh)
 def putAll(self,
            controls,
            silent=False,
            timeout=None,
            fresh=False,
            params=None,
            **kwargs):
     return ClientSide.call("DynamicForm.put", controls, silent, params
                            or scriptURL(kwargs), timeout, fresh)
        def setUIData(self, ui, request):
            search = request.fields.get('search', '')
            if not search:
                usedProducts = []
                for data in GuiBuilderConfig.sections:
                    name = data['Name']
                    numberOfElements = len(data['Factory'].products)
                    elements = data['Factory'].products.iteritems()

                    section = ui.sections.addChildElement(self.buildElement("Accordion", name))
                    section.setLabel(name)
                    section.toggle.attributes['tooltip'] = data['Factory'].__doc__
                    section.style['width'] = "100%"
                    elementsContainer = section.addChildElement(self.buildElement("multiSelect"))
                    elementsContainer.style['height'] = "%dpx" % (numberOfElements * 20)
                    elementsContainer.style['width'] = "100%"
                    elementsContainer.addJavascriptEvent('onchange', self.document.clientSide.get(load=
                                            ClientSide.Script("WebElements.selectedOption(this).value")))

                    for elementName, element in elements:
                        if element in usedProducts:
                            continue
                        else:
                            elementsContainer.addOption(elementName)
                ui.sections[0].addClass("First")
                ui.sections[-1].addClass("Last")
                return

            results = ui.sections.addChildElement(self.buildElement("multiSelect"))
            results.addClass("Results")
            results.style['width'] = "100%"
            results.addOptions([productName for productName in ELEMENTS if search.lower() in productName.lower()])
            results.style['height'] = "%dpx" % (len(results.childElements) * 20)
            results.addJavascriptEvent('onchange', self.document.clientSide.get(load=
                                       ClientSide.Script("WebElements.selectedOption(this).value")))
            return results
 def move(self, to, makeTop=False):
     return ClientSide.move(self.id + ":Loading", to,
                            makeTop)(WebElement.ClientSide.move(
                                self, to, makeTop))
 def delete(self, silent=False, params=None, timeout=None):
     return ClientSide.call("DynamicForm.delete", self, silent, params, timeout)
 def delteAll(self, controls, silent=False, params=None, timeout=None):
     return ClientSide.call("DynamicForm.get", controls, silent, params, timeout)
 def put(self, silent=False, params=None, timeout=None):
     return ClientSide.call("DynamicForm.put", self, silent, params, timeout)
Beispiel #9
0
 def delete(self, silent=False, timeout=None, fresh=False, **kwargs):
     return ClientSide.call("DynamicForm.delete", self, silent, scriptURL(kwargs), timeout, fresh)
Beispiel #10
0
 def delteAll(self, controls, silent=False, fresh=False, timeout=None, **kwargs):
     return ClientSide.call("DynamicForm.get", controls, silent, scriptURL(kwargs), timeout, fresh)
Beispiel #11
0
 def postAll(self, controls, silent=False, timeout=None, fresh=False, params=None, **kwargs):
     return ClientSide.call("DynamicForm.post", controls, silent, params or scriptURL(kwargs), timeout,
                            fresh)
Beispiel #12
0
 def get(self, silent=False, timeout=None, fresh=True, **kwargs):
     return ClientSide.call("DynamicForm.get", self, silent, scriptURL(kwargs), timeout, fresh)
Beispiel #13
0
 def delete(self, silent=False, timeout=None, fresh=False, **kwargs):
     return ClientSide.call("DynamicForm.delete", self, silent,
                            scriptURL(kwargs), timeout, fresh)
Beispiel #14
0
 def get(self, silent=False, timeout=None, fresh=True, **kwargs):
     return ClientSide.call("DynamicForm.get", self, silent,
                            scriptURL(kwargs), timeout, fresh)
Beispiel #15
0
 def move(self, to, makeTop=False):
     return ClientSide.move(self.id + ":Loading", to, makeTop)(WebElement.ClientSide.move(self, to, makeTop))
Beispiel #16
0
 def put(self, silent=False, timeout=None, fresh=False, params=None, **kwargs):
     return ClientSide.call("DynamicForm.put", self, silent, params or scriptURL(kwargs), timeout, fresh)
Beispiel #17
0
 def putAll(self, controls, silent=False, fresh=False, timeout=None):
     return ClientSide.call("DynamicForm.put", controls, silent, scriptURL(kwargs), timeout, fresh)
 def initUI(self, ui, request):
     ui.search.clientSide.focus()
     ui.search.clientSide.on('keyup', ClientSide.hide('contact')(self.contacts.clientSide.get(timeout=500)))
     ui.create.clientSide.on('click', self.contacts.clientSide.put())
     ui.contacts.replaceWith(self.contacts)
     ui.editor.replaceWith(self.editor)